At 06:29 PM 5/23/2004, you wrote:
Hi all.

I've noticed that if I do a 'group by xxx' I get the results sorted by xxx ( when I'm only grouping on 1 field ).
It seems to happen that way every single time.
Is this faster than doing both a 'group by' and 'sort by', and is it something I can rely on?
Just curious...


Dan

Yes, MySQL does always sort on the group by so an Order By on the Group By columns is redundant.
I don't know why more people don't "Read The Fantastic Manual".<g> It is well written and you learn a lot from just skimming a few pages at a time.


Manual:
>>If you use GROUP BY, output rows are sorted according to the GROUP BY columns as if you had an ORDER BY for the same columns. <<


http://dev.mysql.com/doc/mysql/en/SELECT.html

Mike


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to