Home » SQL & PL/SQL » SQL & PL/SQL » UNION ALL
UNION ALL [message #18349] Tue, 29 January 2002 03:55 Go to next message
gg
Messages: 3
Registered: January 2002
Junior Member
how to sort rows in a query made of two separate selects using UNION ALL (I can not use UNION because I've got same rows that I need)
example

select er.one, er.two from evid_one er
union all
select er.one, er.two from evid_two er

I neet to sort ascending the rows by er.two ... the problem is that with UNION I lose duplicate rows and with UNION ALL the results of second query are just "pasted" after the rows of first query
Re: UNION ALL [message #18350 is a reply to message #18349] Tue, 29 January 2002 04:00 Go to previous message
pratap kumar tripathy
Messages: 660
Registered: January 2002
Senior Member
hi,

try

select er.one, er.two from evid_one er
union all
select er.one, er.two from evid_two er
order by 2

here is another example

select ename,empno,job from emp
union all
select ename,empno,job from emp
order by 3

cheers
pratap
Previous Topic: SQL Navigator
Next Topic: PL/SQL Exception Handling
Goto Forum:
  


Current Time: Thu Mar 28 23:51:39 CDT 2024