Add a sequence number for each element in a group using an Oracle SQL query

You can try this:-

 SELECT ID, VALUE, ROW_NUMBER() OVER (PARTITION BY ID ORDER BY VALUE) "GROUPSEQ"
 FROM YOUR_TABLE;

I have written a query for you. I hope it will solve your problem :

(SELECT t.*,
    ROW_NUMBER ()
    OVER (PARTITION BY t.id
          ORDER BY t.id)
       seq_no
  FROM test t);

Check Fiddle


You need ROW_NUMBER

SELECT ID, VALUE, row_number() OVER (PARTITION BY ID ORDER BY value) GROUPSEQ
FROM myTable