Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

sql

Name: Anonymous 2006-03-07 4:23

What do you prefer:

select primary_key
from table_name
group by primary_key
having min(value) <> max(value)

Name: Anonymous 2006-03-08 19:13

>>9
Couldn't the DB optimize it though? Because if it was properly optimized, the latter could be faster.

To find min and max you need to evaluate all values. The other version can stop as soon as it finds two values that don't match.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List