Skip to content
Advertisement

MySQL – #1064 – Something is wrong in your syntax ‘LIMIT 0, 25’

Server: MariaDB, version 10.4.17

Query:

Error in phpMyAdmin:

Error in MySQL Workbench:

All right so MariaDB decided to

  1. modify my query
  2. throw error that shouldn’t be thrown

Let’s find out what is wrong with select something from (select 1, 2 as something) limit 123:

I restarted the server and this error still occurs.

Advertisement

Answer

Both phpMyAdmin and MySQL Workbench will add “LIMIT” clause to the end of your query automatically, this is why you’re getting this misleading message.

But the root cause of the problem is that you need to provide an alias for the sub query, e.g.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement