title: Mysql Query to find near duplicate urls
body: <p>I'm trying to eliminate duplicate domain names (URL's) in a mysql DB table.</p>
  
  <p>I've used this query to find "same" urls:</p>
  
  <pre><code>SELECT URL, 
  COUNT(*) c 
  FROM Links 
  GROUP BY URL 
  HAVING c &gt; 1;
  </code></pre>
  
  <p>But this query fails to find same domain different urls which is what i need:</p>
  
  <pre><code>example.com
  www.example.com
  www.example.com/
  www.example.com/somepage.htm
  </code></pre>
  
  <p>Any help would be very grateful.</p>