[thelist] MySQL Grouping problem

Phil Turmel philip at turmel.org
Mon Apr 11 16:06:14 CDT 2005


Richard/Joshua:

MySQL has an example for this problem that addresses pre-4.1 and current 
syntax (just max instead of min, adjust to suit):

http://dev.mysql.com/doc/mysql/en/example-maximum-column-group-row.html

As for fields in the select list that are neither aggregate nor grouped, 
MySQL extends the standard to pick ANY value from the grouped rows:

http://dev.mysql.com/doc/mysql/en/group-by-hidden-fields.html

HTH,

Phil


More information about the thelist mailing list