SyntaxFix
Write A Post
Hire A Developer
Questions
So before MySQL 8.0 there is no ROW_NUMBER() function. Accpted answer rewritten to support older versions of MySQL:
SET @row_number = 0; SELECT t.A, t.B, t.C, (@row_number:=@row_number + 1) AS number FROM dbo.tableZ AS t ORDER BY t.A;