Actual solution to conflicts between MySQL field names and reserved words

Source: Internet
Author: User

The following articles mainly describe the actual solution to conflicts between MySQL field names and reserved words. We all know that conflicts between MySQL field names and reserved words often occur in actual operations, therefore, the corresponding solutions have attracted much attention.

I just found that two fields in my original database table use the reserved word add and comment ). An error occurred during insert and update. I remember that SQL server seems to be surrounded. So I tried it and it turns out that it won't work in MySQL. After a simple search on the Internet, we found that brackets were used.

Later, I thought that the SQL statement generated by MySQL Administrator would enclose all the table names in single quotes. After trying it out, it still won't work. But the generated symbol can be copied. Make sure that the symbol is not a single quotation mark. At first glance, the marker is on the key before Number 1 ). Solve this problem. The following is a summary:

In MySQL, when the table name, field name, or Database Name Conflict with the reserved word, you can use an underscore (') in an SQL statement.


The above content is an introduction to the solutions to conflicts between the MySQL field names and reserved words. I hope you will find some gains.

Related Article

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.