Hello all,
I want a query for show all the record along with serial number.Here i mentioned a sample table along with data.
COMPCODE | ITEMCODE | ACTIVITY | DESIGNATION | QTY |
105 | 001 | A13 | D7 | 50 |
105 | 001 | A22 | D7 | 44 |
105 | 001 | A34 | 7 | 54 |
105 | 001 | A45 | D7 | 34 |
105 | 001 | A45 | D8 | 54 |
105 | 001 | A52 | D13 | 32 |
105 | 001 | A52 | D14 | 3 |
105 | 001 | A61 | D2 | 43 |
105 | 002 | A12 | D1 | 43 |
105 | 002 | A25 | D1 | 53 |
105 | 002 | A35 | D5 | 42 |
105 | 002 | A35 | D4 | 45 |
105 | 002 | A35 | D3 | 65 |
105 | 002 | A44 | D2 | 423 |
105 | 002 | A55 | D3 | 43 |
105 | 002 | A62 | D4 | 65 |
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
COMPCODE | ITEMCODE | SLNO | ACTIVITY | DESIGNATION | QTY |
105 | 001 | 1 | A13 | D7 | 50 |
105 | 001 | 2 | A22 | D7 | 44 |
105 | 001 | 3 | A34 | D7 | 54 |
105 | 001 | 4 | A45 | D7 | 34 |
105 | 001 | 4 | A45 | D8 | 54 |
105 | 001 | 5 | A52 | D13 | 32 |
105 | 001 | 5 | A52 | D14 | 3 |
105 | 001 | 6 | A61 | D2 | 43 |
105 | 002 | 1 | A12 | D1 | 43 |
105 | 002 | 2 | A25 | D1 | 53 |
105 | 002 | 3 | A35 | D5 | 42 |
105 | 002 | 3 | A35 | D4 | 45 |
105 | 002 | 3 | A35 | D3 | 65 |
105 | 002 | 4 | A44 | D2 | 423 |
105 | 002 | 5 | A55 | D3 | 43 |
105 | 002 | 6 | A62 | D4 | 65 |
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