About the operation of the data table when it is named MySQL reserved

Source: Internet
Author: User

Today, when manipulating the data sheet, it is found that the order data table cannot be manipulated and must be inverted with single quotation marks to perform the operation and check the cause:

Anti-quotes are used to differentiate the MySQL keyword, for example, if you have a table named Select, you have to write ' select ' because select is the MySQL reserved word. The anti-quotation marks are added to the database name, the data table name, and the field name of the data table.


Example:

Non-inverted single quotes:

MySQL>createtableorder1064 (42000 in Check  to  for  Right  to  Use ' Order ' 1

Add anti-single quotes:

Mysql>ShowCreate Table`Order' \g;*************************** 1. Row***************************       Table:OrderCreate Table:CREATE TABLE`Order' (' oid ' )int( One) not NULLAuto_increment COMMENT'Order Number', ' CID 'int( One) not NULL, ' pid 'int( One) not NULL, ' Onum 'int( One) not NULL,  PRIMARY KEY(' oid ')) ENGINE=InnoDB auto_increment=5 DEFAULTCHARSET=UTF8 COLLATE=Utf8_bin1Rowinch Set(0.00Sec

Inverted single quotation marks above the TAB key

About the operation of the data table when it is named MySQL reserved

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.