UNION ALL [message #18349] |
Tue, 29 January 2002 03:55 |
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 |
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
|
|
|