Feb 042013
 
select distinct o.rows_and_columns
from   one_table o, 
       matching_rows_in_another m
where  o.i_should_have_used = m.a_subquery
and    m.saved_myself_a_sort = 'Y'
While there's some legitimate uses of distinct, 
if you're relying on it to remove duplicates something is probably wrong

Click here for a script showing this and (better) alternative queries

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)