Column names and apostrophes

Go To


I'm quite new to MySQL and I'm confused with one problem: I have one table on which I cannot perform queries without apostrophes surrounding column names, but for the rest of tables it is possible. I need to do queries without apostrophes to be able to do the same on parrarel HSQL database. On what is it dependent? All tables in MySQL are InnoDB.

2012-04-04 06:50
by user1091733


Your table/column name(s) has a reserved keyword.

2012-04-04 06:53
by hkf
thanks for saving a lot of my time - user1091733 2012-04-04 06:56


You need apostrophes if a column name is a reserved word or if it contains blanks or special characters. Same is true for the table name.

2012-04-04 06:54
by Hubert Schölnast


Use table names which are not included in reserve words then you didnot need apostrophes(`).

2012-04-04 07:14
by Ankit Sharma