Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL min value

Re: SQL min value

From: Mark Styles <news_at_lambic.co.uk>
Date: Mon, 19 Nov 2001 16:33:55 GMT
Message-ID: <00divt817olorjq1ibifvdovmjl1np3g86@4ax.com>


On Mon, 19 Nov 2001 16:08:18 +0100, "gil guerillot" <gil.guerillot_at_ratp.fr> wrote:
> table with 3 fields OBJ,V1,V2
>
>I need sql select
>how to find for each OBJ,the V1 value corresponding at the record where V2
>is the smaller?

Not sure if I've understood what you mean, but how about this:

SELECT obj, v1
FROM mytable
GROUP BY obj
HAVING MIN(v2);

Can't test that at the moment because our db is down *sigh* Received on Mon Nov 19 2001 - 10:33:55 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US