How does mysql define DISTINCT()
- by goran
AFAIK SQL defines two uses of DISTINCT keywords - SELECT DISTINCT field... and SELECT COUNT(DISTINCT field) ...
However in one of web applications that I administer I've noticed performance issues on queries like
SELECT DISTINCT(field1), field2, field3 ...
DISTINCT() on a single column makes no sense and I am almost sure it is interpreted as
SELECT DISTINCT field1, field2, field3 ...
but how can I prove this?
I've searched mysql site for a reference on this particular syntax but could not find any. Does anyone have a link to definition of DISTINCT() in mysql or knows about other authoritative source on this?
Best