Received: from zmail6.easynet.fr (email.easynet.fr [195.114.64.207]) by hub.org (8.9.3/8.9.3) with SMTP id JAA62425 for ; Sun, 19 Dec 1999 09:27:17 -0500 (EST) (envelope-from tesio@easynet.fr) Received: (qmail 29615 invoked from network); 19 Dec 1999 14:27:16 -0000 Received: from mailgate3.easynet.fr (192.168.1.4) by mailserver.easynet.fr with QMQP; 19 Dec 1999 14:27:16 -0000 Received: from pop-nice-241.pops.easynet.fr (HELO atesio) (195.114.95.241) by mrelay3.easynet.fr with SMTP; 19 Dec 1999 16:31:48 -0000 Message-ID: <007f01bf4a2d$658a2800$f15f72c3@atesio> From: "Alain TESIO" To: References: <385C1F8E.2CC771A7@nlr.ru> <385C3BE0.D307E8B5@mascari.com> Subject: group by / having Date: Sun, 19 Dec 1999 15:28:59 +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