Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL min value
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
![]() |
![]() |