PL/SQL (MOSC)

MOSC Banner

Insert Sequence Number based on key value

edited Feb 18, 2014 12:00PM in PL/SQL (MOSC) 8 commentsAnswered

Hello everyone,

  I have a table(Product_details) like shown below:

   Store_Id      Item_Id   Count

     5001           3001          5

     5001           3002          4

     5001           3003          4

     5001           3003          2

     5002           3001          0

     5002           3002          4

     5002           3003          4

     5002           3004          5

     5003           3001          9

     5003           3002          7

     5003           3003          4

     5003           3004          2

     5003           3005          1

     5003           3006          5

Now, I have been added one more column(Seq_No) in the table and I want to insert sequence number into the column(Seq_No) based on Store_Id, which is the key value.

The insertion should be like shown below:

                  

        Seq_No       Store_Id      Item_Id   Count

             1               5001           3001          5

             2               5001           3002          4

             3               5001           3003          4

             4               5001           3003          2

             1               5002           3001          0

             2               5002           3002          4

             3               5002           3003          4

             4               5002           3004          5

             1               5003           3001          9

             2               5003           3002          7

             3               5003           3003          4

             4               5003           3004          2

             5               5003           3005          1

             6               5003           3006          5

I would really great full, if anyone advise me 

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center