Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: MIN value from a column in 2 tables.
This should do it:
select min(ID) from (select * from table1 union select * from table2);
"Mark" <mark.harris.spam.begone_at_ukonline.co.uk.spam.begone> wrote in message news:<3e2c2cf6$0$2577$afc38c87_at_news.easynet.co.uk>...
> Hello,
>
> I'm trying to write some code to select the MIN value from a column which
> exists separately in 2 tables. The table structure is the same but the data
> is different.
>
> E.g. table 1:
>
> ID Name
> ---- ----
> 10 Smith
> 11 Jones
>
> table 2:
>
> ID Name
> ---- ----
> 1 Bloggs
> 12 Chang
>
> I need to identify that the MIN value of ID is 1.
>
> Any suggestions as how to do this?
>
> Thanks,
>
> Mark
Received on Mon Jan 20 2003 - 21:09:54 CST
![]() |
![]() |