Re: Howto?? - Mailing list pgsql-sql

From chester c young
Subject Re: Howto??
Date
Msg-id 20030317185752.59785.qmail@web12702.mail.yahoo.com
Whole thread Raw
In response to Howto??  ("J.C.M. van der Kwast" <jkwast@home.nl>)
List 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


pgsql-sql by date:

Previous
From: "J.C.M. van der Kwast"
Date:
Subject: Min values?
Next
From: "David Witham"
Date:
Subject: parse error when calling function in plpgsql