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!

Order by with dual

Mrudula BandaruMay 24 2017 — edited May 24 2017

Hi,

I am trying to do union all on dual and select statement with order by ERP column.

select 'PD','ERP' ERP,'ACCOUNT','RECORD','AMT' from dual

UNION ALL

select MONTH,ERP,ACCOUNT,RECORD,AMOUNT from AC_BK_TAB

ORDER BY ERP

This gives result in Asc order by ERP. But I have ERPs starting from character 'Bxxx' and hence header record which has 'ERP' is coming in the middle of the record set.

Can I have order by on ERP on the second query itself having header as first record.

Thanks in advance

This post has been answered by Etbin on May 24 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 21 2017
Added on May 24 2017
20 comments
1,371 views