Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Merge 2 select statements ?
mhk wrote:
>
> Hi,
>
> can anyone know how to merge two select statements into one
>
> Example :
>
> "select * from emp where location_id = 1"
> other is
> "select * from emp where location_id = 2"
>
> Now how can i merge these two with a single select statement. its a
> simple example but i am using a tough one in reality.
>
Basic SQL!
Select *
from emp
where location_id IN (1, 2, 3 ...)
OR
Select *
from emp
where location_id = 1
OR location_id = 2;
Please get an Intro to SQL book or course (or stay awake & take notes during the course, if you are a student). There may Be Many alternate solutions and a blanket answer in this newsgroup may not be correct in some situations. Received on Thu Nov 27 2003 - 17:34:56 CST
![]() |
![]() |