title: MySQL - Changing the query to be distinct on just 1 column
body: <p>I have the following query which works except that I would like it to behave differently. Now it looks for all the duplicate rows on <code>url</code> and returns it in the order of number of duplicate urls. I use GROUP_ CONCAT to seperate all the different screen_name's. </p>
  
  <p>However there can be multiple rows with the same url and same screen_name. How do I make it so that it only retreives the rows where screen_name is distinct.</p>
  
  <pre><code>SELECT url, title, GROUP_CONCAT( screen_name ) , COUNT( t_uid )
              FROM `twl_links`
              WHERE twl_uid =3
              AND timestamp &gt;= NOW( ) - INTERVAL 24 HOUR
              GROUP BY (
              url
              )
              ORDER BY COUNT( t_uid ) DESC
  </code></pre>