X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7F59CD7716 for ; Tue, 11 Oct 2005 18:12:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55829-03 for ; Tue, 11 Oct 2005 21:12:22 +0000 (GMT) Received: from sccrmhc14.comcast.net (sccrmhc14.comcast.net [204.127.202.59]) by svr1.postgresql.org (Postfix) with ESMTP id 8B878D76E6 for ; Tue, 11 Oct 2005 18:12:23 -0300 (ADT) Received: from dell8200 (pcp09613107pcs.rte20201.de.comcast.net[68.82.197.68]) by comcast.net (sccrmhc14) with SMTP id <200510112112220140034qtie>; Tue, 11 Oct 2005 21:12:22 +0000 From: "Rick Schumeyer" To: Subject: pg, mysql comparison with "group by" clause Date: Tue, 11 Oct 2005 17:12:20 -0400 Message-ID: <001001c5cea8$77cabc90$0300a8c0@dell8200> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 In-reply-to: <13793.1129039438@sss.pgh.pa.us> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 required=5 tests=[AWL=0.001] X-Spam-Level: X-Archive-Number: 200510/95 X-Sequence-Number: 22948 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?