title: SELECT DISTINCT with field type 'text' and SUM(amt)
body: <p>I'm having trouble with a SQL query:</p>
  
  <p>This is what I'm trying to do:</p>
  
  <pre><code>"SELECT DISTINCT *, SUM(amt) AS ttl_amt FROM table WHERE..."
  </code></pre>
  
  <p>Two of my fields are of type 'text', SQL does not allow for this type to be selected as DISTINCT as they are not comparable.</p>
  
  <p>I need to group relative items and display them as a single row with a combined <code>ttl_amt</code> value as seen above.</p>
  
  <p>I've tried selecting the 'non-text' fields (varchar, float, int, etc) in the <code>SELECT DISTINCT</code> statement and then pulling the 'text' fields in a <code>while()</code> loop using another SQL query but that information does not show up (the 'text' fields).</p>
  
  <p>If you need more information let me know.</p>
  
  <p>Any ideas? I'm not an expert when it comes to SQL syntax.</p>