Sunday 15 February 2015

command line - Is it possible to use "Index" as column name in mysql -


I will have to make the database and table through the mysql command line because the only way to access the server is. I tried to create a table with an index column (instead of the more common "id" column), though it was giving me an error

I have found that "index" is one in my SQL There is a command, but I will not have to change the name of that column, from which I have been set up to deal with the databases for sustainability programs that are being managed 'I am making.

How do I stop "command line" from interpreting "index" as an order?

You can add names to backquotes. It allows the reserved word to be used as the name of columns and tables, as is a bad idea.

  Create table T (`index 'primary primary key, ...);   

Whenever you mention the column, you have to use backquotes.

No comments:

Post a Comment