pg, mysql comparison with "group by" clause - Mailing list pgsql-sql

From Rick Schumeyer
Subject pg, mysql comparison with "group by" clause
Date
Msg-id 001001c5cea8$77cabc90$0300a8c0@dell8200
Whole thread Raw
In response to Re: question re. count, group by, and having  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg, mysql comparison with "group by" clause
Re: pg, mysql comparison with "group by" clause
List 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?



pgsql-sql by date:

Previous
From: Frank Bax
Date:
Subject: Re: SEVEN cross joins?!?!?
Next
From: Scott Marlowe
Date:
Subject: Re: pg, mysql comparison with "group by" clause