Last answered:

04 Feb 2024

Posted on:

03 Feb 2024


ROW_NUMBER() is not working

When I'm trying to use ROW_NUMBER() it seems that MySql is not reading it properly (the line is black not blue) hence

it is not working. It has to do with the MySQL version? And how can I fix that?

Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server

version for the right syntax to use near '() AS row_num FROM  salaries' at line 3.

I'm eagerly awaiting your response,

Best regards,


1 answers ( 0 marked as helpful)
Posted on:

04 Feb 2024


Hi Dhruv!

Thanks for reaching out.

1) Can you please confirm you have written no query on row 1, ending without using a

statement terminator ; at the end ?

2) If that's not the case, please consider we were referring to version MySQL 8.0 or above.
Currently, you seem to be using a 5.7 version. Please update.

Hope this helps but please feel free to get back to us should you need further assistance.
Thank you!

Kind regards,

Submit an answer