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!

Query for Serial number

885742Oct 19 2013 — edited Oct 20 2013

Hello all,

I want a query for show all the record along with serial number.Here i mentioned a sample table along with data.

COMPCODEITEMCODEACTIVITYDESIGNATIONQTY
105001A13D750
105001A22D744
105001A34754
105001A45D734
105001A45D854
105001A52D1332
105001A52D143
105001A61D243
105002A12D143
105002A25D153
105002A35D542
105002A35D445
105002A35D365
105002A44D2423
105002A55D343
105002A62D465

These is the sample table along with data.My requirement is I want show the serial number based on the itemcode and activity.

The final result should be  like this

COMPCODEITEMCODESLNOACTIVITYDESIGNATIONQTY
1050011A13D750
1050012A22D744
1050013A34D754
1050014A45D734
1050014A45D854
1050015A52D1332
1050015A52D143
1050016A61D243
1050021A12D143
1050022A25D153
1050023A35D542
1050023A35D445
1050023A35D365
1050024A44D2423
1050025A55D343
1050026A62D465

I tried write a query  used with row_number() function  but i didn't get the exact output.kindly help me for getting this type of output

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 17 2013
Added on Oct 19 2013
4 comments
3,504 views