Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to preserve the order when using UNION

709949Oct 24 2012 — edited Oct 24 2012
Hi,

I'm combining three queries using the UNION operator.

for ex:

select 'a' from DUAL
union
select 'd' from DUAL
union
select 'b' from DUAL
union
select 'c' from dual;

I would like to see the same order as

a
d
b
c

but it is showing as

a
b
c
d

is it possible without using ORDER BY clause?

Please give some idea.

Thanks,
Kiran
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2012
Added on Oct 24 2012
8 comments
2,650 views