Home Ask Login Register

Developers Planet

Your answer is one click away!

Noor Chaudhry February 2016

MYSQL column containing % symbol

I am trying to create a table with a the column name aggregate_report_90%_line in mysql. I am getting a syntax error because of the % symbol. How do I create a column with % symbol?


recycler February 2016

You have to escape it with \% . But it is not a good style. Avoid it. http://dev.mysql.com/doc/refman/5.7/en/string-literals.html

You should avoid it because '%' is a special symbol which can be used in select queries as a wildcard.

Aleksey Ratnikov February 2016

You should always qoute it with backticks:


Post Status

Asked in February 2016
Viewed 1,725 times
Voted 7
Answered 2 times


Leave an answer

Quote of the day: live life