Scott Noyes wrote:

It appears that you don't need to
specify in the Group By clause all the columns that are referenced without
an aggregate function


True.


For example this query would be invalid in MSSQL but
valid in MySQL:

select id, vendor, sum(price)
from p
group by id


In this case, `vendor` would hold the vendor value from some random
record with the `id` indicated.  In practice, it's the first one as it
appears in the table, but that is not guaranteed.

Right. Mysql allows this as a convenience, but warns against selecting columns which do not have unique values per group. See the manual for the details <http://dev.mysql.com/doc/mysql/en/group-by-hidden-fields.html>.

Michael


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

Reply via email to