On Jun 23, 8:39 am, Chirag Singhal <[email protected]> wrote:
> Strictly speaking, both the adapters are implementing what's right as per
> each database.
> And since MySQL chose to implement "group by" clause differently and most
> rails devs have been using mysql as default database, we are used to use
> "group by" the mysql way.

Actually, MySQL defaults to allowing you to do non standard group by
operations.
http://dev.mysql.com/doc/refman/5.1/en/server-sql-mode.html#sqlmode_only_full_group_by

As the link points out, the following query is allowed when the
ONLY_FULL_GROUP_BY option is not enabled (which I think is the
default):
SELECT name, address, MAX(age) FROM t GROUP BY name;

I've always thought this was a really bad default for MySQL, and
PostgreSQL is rightfully complaining that the query should be:
SELECT name, address, MAX(age) FROM t GROUP BY name, address;

- Eric

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to