Received: from zmail6.easynet.fr (email.easynet.fr [195.114.64.207]) by hub.org (8.9.3/8.9.3) with SMTP id LAA80327 for ; Sun, 19 Dec 1999 11:03:01 -0500 (EST) (envelope-from tesio@easynet.fr) Received: (qmail 50726 invoked from network); 19 Dec 1999 16:03:01 -0000 Received: from mailgate3.easynet.fr (192.168.1.4) by mailserver.easynet.fr with QMQP; 19 Dec 1999 16:03:01 -0000 Received: from pop-nice-253.pops.easynet.fr (HELO atesio) (195.114.95.253) by mrelay3.easynet.fr with SMTP; 19 Dec 1999 18:07:34 -0000 Message-ID: <00cb01bf4a3a$c6046a80$f15f72c3@atesio> From: "Alain TESIO" To: Subject: group by / having Date: Sun, 19 Dec 1999 17:04:40 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Hello, Do you know why this command doesn't work ? > select * from T; x|y -+- 1|1 1|2 2|1 2|2 2|3 > select X,Y from T group by X having Y=min(Y); ERROR: Illegal use of aggregates or non-group column in target list My goal is quite simple : get only one line per X value (the value which is returned for Y is not important as long as it's one of the values linked to the right X). The query "select X,Y from T group by X" works under MySQL and returns exactly what I want, how can I do it in PostgreSQL ? Thanks for your help, Alain