pg, mysql comparison with "group by" clause

From: "Rick Schumeyer" <rschumeyer(at)ieee(dot)org>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: pg, mysql comparison with "group by" clause
Date: 2005-10-11 21:12:20
Message-ID: 001001c5cea8$77cabc90$0300a8c0@dell8200
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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?

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2005-10-11 21:21:27 Re: pg, mysql comparison with "group by" clause
Previous Message Frank Bax 2005-10-11 20:06:20 Re: SEVEN cross joins?!?!?