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
Here's another way with a query that is simpler (at least for me):
SELECT
a.Id, a.Name,
(SELECT COUNT(*) FROM test
WHERE Id = a.Id AND `Name` = a.Name AND row_id < a.row_id) AS RowNum
FROM test AS a
ORDER BY a.row_id;
This supposes there exists a global row_id
(for instance an auto-increment primary key in your table).