Re: pg, mysql comparison with "group by" clause

From: "Anthony Molinaro" <amolinaro(at)wgen(dot)net>
To: "Rick Schumeyer" <rschumeyer(at)ieee(dot)org>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: pg, mysql comparison with "group by" clause
Date: 2005-10-11 21:22:42
Message-ID: 3C6C2B281FD3E74C9F7C9D5B1EDA45821825FF@wgexch01.wgenhq.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

You're 100% correct, this is a bug in mysql.

Sadly, they tout this as a feature!

-----Original Message-----
From: pgsql-sql-owner(at)postgresql(dot)org
[mailto:pgsql-sql-owner(at)postgresql(dot)org] On Behalf Of Rick Schumeyer
Sent: Tuesday, October 11, 2005 5:12 PM
To: pgsql-sql(at)postgresql(dot)org
Subject: [SQL] pg, mysql comparison with "group by" clause

I'm not sure what I was thinking, but I tried the following query in pg:

SELECT * FROM t GROUP BY state;

pg returns an error.

Mysql, OTOH, returns the first row for each state. (The first row with
"AK", the first row with "PA", etc.)

I'm no SQL expert, but it seems to me that the pg behavior is correct,
and
the mysql result is just weird. Am I correct?

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Browse pgsql-sql by date

  From Date Subject
Next Message Muralidharan Ramakrishnan 2005-10-11 21:27:48 Re: question re. count, group by, and having
Previous Message Scott Marlowe 2005-10-11 21:21:27 Re: pg, mysql comparison with "group by" clause