SyntaxFix
Write A Post
Hire A Developer
Questions
You can also use
SELECT @curRow := ifnull(@curRow,0) + 1 Row, ...
to initialise the counter variable.