X-Original-To: pgsql-sql@postgresql.org Received: from web12702.mail.yahoo.com (web12702.mail.yahoo.com [216.136.173.239]) by postgresql.org (Postfix) with SMTP id 9B917474E53 for ; Mon, 17 Mar 2003 13:57:52 -0500 (EST) Message-ID: <20030317185752.59785.qmail@web12702.mail.yahoo.com> Received: from [63.230.97.206] by web12702.mail.yahoo.com via HTTP; Mon, 17 Mar 2003 10:57:52 PST Date: Mon, 17 Mar 2003 10:57:52 -0800 (PST) From: chester c young Subject: Re: Howto?? To: "J.C.M. van der Kwast" Cc: pgsql-sql@postgresql.org In-Reply-To: <000801c2ec89$f70eeb60$04a779d9@cc299057a> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200303/408 X-Sequence-Number: 12447 > I have a table with id column, another id (id2) column and a value > column. For each id there can be more id2. I want id2 for id where > the value is min. > thanks sjors select distinct id2 from tab where id=x and value = (select max(value) from tab where id=x) __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com