This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13918|Reply: 0

[Source] mysql table fields or variables are the solution to keywords

[Copy link]
Posted on 7/18/2016 3:36:29 PM | | | |

I have studied Microsoft SQL, if I encounter a table name that I define as a keyword,

I usually add [] on both sides, and that's fine.

But mysql, I don't know.


The processing method of table names in MySQL for keywords
This is a simple SQL statement that inserts data into the order table. See where you are wrong?
INSERT INTO order VALUES ('1471', 'go-1471-1-3340');
An error will be reported when executed:
[Err] 1064 - 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 'order VALUES ('1471', 'go-1471-1-3340') at line 1
Problems and Solutions:
      The table name order uses the keyword of mysql, and you need to enclose order with an apostrophe, which is the key to the left of data 1 on the keyboard.
INSERT INTO `order` VALUES......





Previous:C# operates the MySQL database driver as well as the help class
Next:mysql execution stored procedure with return value
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com