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!

ROWNUM in UNION operator

Sen2008Feb 18 2013 — edited Feb 18 2013
All,

I have a requirement in SQL that I have to number each row. Hence I thought of using ROWNUM. But the sql query I'm using uses UNION operator. Hence I used like this

select a,b,rownum as 'field1' from table1
union
select c,d,1 as 'field1' from table2

Will the above query solve my purpose?

thanks
sen
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 18 2013
Added on Feb 18 2013
11 comments
6,149 views