Get the App
SLTechnology News&Howtos  ›  Database  › 

How to solve mysqlERROR 1064

Shulou Source: shulou.com Published: 2022-06-01 08:25:08 11月10日 Update

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

Tags: Quotation marks fields success normal content characters symbols no examples names strings numbers time green statements guarantees input Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Microsoft macOS Xiaomi Apple