Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Merge 2 select statements ?
Hi Jeff!
have you ever tried
select ename, '3' As rate from emp where sal = 950
union all
select ename, '1' As rate from emp where sal = 11950;
Works definitly for Oracle 8i and above. I'm not sure if it already supported by 7.x
Bye,
Chris!
"mhk" <cccssss_at_dddsssl.com> schrieb im Newsbeitrag
news:3FC66354.2080602_at_dddsssl.com...
> Thanks but ,
>
> As i said earlier i need to merge two tough separate select statement in
> reality.
>
> Please help me in merging this following select Statements
>
>
> select ename, '3' As rate from emp where sal = 950;
>
> other is
>
> select ename, '1' As rate from emp where sal = 11950;
>
>
> i Hope now its clear, as now u cannot use your previous statement.
>
>
> Please help ,
>
>
> Thanks
>
> Jeff
>
> *********************************************
>
> Thomas Kellerer wrote:
> >
> >
> > mhk schrieb:
> >
> >> 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.
> >>
> >> Thanks
> >>
> >>
> >> Jeff
> >>
> >
> > select * from emp where location_id in (1,2)
> >
> >
>
Received on Thu Nov 27 2003 - 15:55:00 CST