[MySQL] Getting stuck with reserved words - ERROR 1064 (42000): 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 'xxx' at line 1
In MySQL, when I executed SQL that looked absolutely fine, a syntax error occurred.
mysql> SELECT * FROM addresses ORDER BY primary;
ERROR 1064 (42000): 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 'primary' at line 1
Since primary is apparently a reserved word, it was fine when I surrounded it with single quotes and executed it.
mysql> SELECT * FROM addresses ORDER BY 'primary';
That’s all from the Gemba.