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!

Union with header row with order by

SamBDec 4 2006 — edited Dec 4 2006
select 'Heading1', 'Heading2'
from dual
union all
select col1, col2
from myTable
order by col1

The above query obviously does not work, is it possible to re-write the query so it does? To be more specific I want to select a header row that is always the first row returned but I want the rest of the rows to be ordered by one of the columns in the second query.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 1 2007
Added on Dec 4 2006
2 comments
1,064 views