Re: Howto??

From: chester c young <chestercyoung(at)yahoo(dot)com>
To: "J(dot)C(dot)M(dot) van der Kwast" <jkwast(at)home(dot)nl>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Howto??
Date: 2003-03-17 18:57:52
Message-ID: 20030317185752.59785.qmail@web12702.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> 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

In response to

  • Howto?? at 2003-03-17 13:34:41 from J.C.M. van der Kwast

Browse pgsql-sql by date

  From Date Subject
Next Message Tomasz Myrta 2003-03-17 19:06:41 Re: Howto??
Previous Message Larry Rosenman 2003-03-17 18:02:07 Re: Formatting intervals..