Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve mysqlERROR 1064

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The difference between backquotation marks and single quotation marks in Mysql

Backquotation marks, usually below the ESC key.

It is a symbol introduced to distinguish between reserved words and ordinary characters in MYSQL.

For example: SELECT select FROM test WHERE select=' field value'

In the test table, there is a select field, and if you do not use backquotes, MYSQL will treat select as a reserved word, resulting in an error, so those with MYSQL reserved words must be distinguished in backquotes.

Quotation marks are generally used in the value of a field. If the field value is a character or string, add quotation marks, such as: select=' field value'

Tables built without backquotes cannot contain MYSQL reserved words, otherwise there will be an error

With ordinary quotation marks, when entering left quotation marks, the following content defaults to the contents within the quotation marks because the quotation marks are not closed, and the contents enclosed in ordinary quotation marks are green.

When we build a table, we usually put the table name and library name in reverse quotation marks to ensure the execution of the statement. Backquotation marks, the symbol to the left of the number 1. Reserved words cannot be used for table names, such as desc, which need to be distinguished by backquotation marks, but can be ignored when using table names. Create tabledesc error create tabledesc successful create tabletest successful drop tabletest reserved words cannot be used for field names, such as desc, backquotation marks are also required, and backquotation marks are also required when insert is used. Create tabletest (descvarchar (255)) succeeded insert into test (desc) values ('fxf') failed insert into test (' fxf') values ('fxf') succeeded

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report