A Little Noise

November 15, 2005

Distinct Count

Filed under: MySQL Gotchas — snoyes @ 4:00 am
SELECT COUNT(DISTINCT someField) FROM someTable;
SELECT DISTINCT someField FROM someTable;

T/F: The value returned by the first will always equal the number of rows returned by the second.
Show Answer ▼

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress