I have one table in MYSQL It has data like
Id Name 1 test 1 test 1 test123 2 test222 3 test333
I want the data like
Id Name RowN
select id, name, (select count(*) + 1 from table as i where i.id = p.id and i.id < p.id ) from table p;