title: How to make a list from a query?
body: <p>I run a query and want to make a list from this query. I only need those select items, which I got, but I can't get rid of <code>&quot;,&quot;</code> in <code>lst</code>.</p>
  <p>I tried <code>replace</code> but it didn't work.</p>
  <pre><code>query = &quot;&quot;&quot;
  select
      supplier_no_and_name,
      accepted,
      rejected,
      pending,
      tdc
  from edl_current.supplier_warranty_cost_recovery_warranty_alteryx 
  where claim_date &gt; &quot;2021-01-01&quot;
  &quot;&quot;&quot;
  
  
  lst = query.split()
  lst = lst[1-len(lst):len(lst)-13]
  
  for i in range(len(lst)):
      lst[i].replace(',',&quot;&quot;)
  print(lst)
  </code></pre>
  <p>The output is following:</p>
  <pre><code>['supplier_no_and_name,', 'accepted,', 'rejected,', 'pending,', 'tdc']
  </code></pre>