Pages

Saturday, December 4, 2010

MySQL - Having reserved key word as a column name

In MySql you will run into trouble when you try to execute a query if you have a reserved keyword as a column name. As an example let's take "update google_mapping set Open_Market='N' where Group='Taiwan';. Group is a reserved keyword in MySql. Solution is to surround keyword with ``. So in the above example you have to modify the query like this.
"update google_mapping set Open_Market='N' where `Group`='Taiwan'";