I'm migrating my database from MSSQL to MySQL. AFAIK, before version 8, MySQL doesn't support ROW_NUMBER
like in MSSQL. How should I do the migration for the following query.
SELECT
A.Att1,
B.Att2,
...
SeqNr = ROW_NUMBER() OVER (PARTITION BY A.ID, B.AnotherID ORDER BY C.SomeAttribute DESC),
FROM TableOne A
INNER JOIN TableTwo B
ON A.ID = B.ID
INNER JOIN TableThree C
ON B.ID = C.ID
The ROW_NUMBER() OVER (PARTITION...ORDER BY)
part should work out of the box for MySQL 8+, but I'm currently using 5.7, what is the best alternative?
Thanks.