pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: chester c young <chestercyoung@yahoo.com>
To: J.C.M. van der Kwast <jkwast@home.nl>
Cc: pgsql-sql@postgresql.org
Subject: Re: Howto??
Date: Mon, 17 Mar 2003 10:57:52 -0800 (PST)
Message-ID: <20030317185752.59785.qmail@web12702.mail.yahoo.com> (raw)
In-Reply-To: <000801c2ec89$f70eeb60$04a779d9@cc299057a>

> 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



view thread (5+ messages)  latest in thread

Message-ID: <20030317185752.59785.qmail@web12702.mail.yahoo.com>
Permalink:  ../20030317185752.59785.qmail@web12702.mail.yahoo.com/
Also on:    postgresql.org/message-id/20030317185752.59785.qmail@web12702.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: chestercyoung@yahoo.com, jkwast@home.nl
  Subject: Re: Howto??
  In-Reply-To: <20030317185752.59785.qmail@web12702.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox