Re: MIN value from UNION?
From: Sridhar Subramaniam <avion_at_ozemail.com.au>
Date: 1996/11/13
Message-ID: <32899999.781D_at_ozemail.com.au>#1/1
Date: 1996/11/13
Message-ID: <32899999.781D_at_ozemail.com.au>#1/1
akm wrote:
>
> I'd need to return the MIN value from the following query:
>
> select col1 from tab1
> union
> select col2 from tab2
>
> Thanks!
If you are using Oracle 7.1+,
select min( col )
from ( select col1 col from tab1
union select col2 col from tab2 ) should do the trick.
-- Cheers Sridhar Subramaniam Avion Consulting Services Sydney - Australia Email : avion_at_ozemail.com.au Disclaimer : All opinions are truly and just mine.Received on Wed Nov 13 1996 - 00:00:00 CET