Skip to content
Advertisement

What did I miss in this MariaDB query? I’m getting now a SQL syntax error

Every time I get Error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘by, user, reason, active) VALUES (5, 663403380223377400, 793061601288388600, 274’.

Did I miss something in the query?

MariaDB version: 10.1.47

Kind Regards,

Corné

Advertisement

Answer

by is a reserved word in MySQL and in MariaDB, so you need to quote it:

A better idea would be to use an identifier that does not conflict with a reserved word (or keyword). There are plenty of words in English, and just a few hundred are SQL keywords.

Note that I also quoted user: it is not a reserved word, but a language keyword, but it is still a good practice to quote it.

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