How does mysql define DISTINCT()
Posted
by goran
on Stack Overflow
See other posts from Stack Overflow
or by goran
Published on 2010-03-19T09:59:40Z
Indexed on
2010/03/19
10:01 UTC
Read the original article
Hit count: 306
mysql-query
|mysql
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
© Stack Overflow or respective owner