Problems with reserved fields in Mysql _mysql

Source: Internet
Author: User
Tags reserved

You have a error in your SQL syntax; Check the manual that corresponds to your MySQL server Versio This sentence is not unfamiliar to us, nothing more than "," and so on. But if you accidentally added a reserved field in MySQL as the name of the field stored in the database, the tragedy happened.

A few days ago because of the temporary changes in functionality, you need to add a field to the datasheet to distinguish the imported batches, I added the Group field to MySQL, and I didn't expect my nightmare to unfold
Originally the procedure is close to the end, this morning to the company to the program to a happy ending, did not think Every time I import an Excel table always prompts me for SQL statement errors, I change the SQL statement to add subtraction, also did not fix the error, a whole morning plus two hours in the afternoon, it is almost to the degree of madness. I was almost on my knees, but I still didn't fix the mistake.
Put the problem aside and keep doing other things. When you write a group by statement, you suddenly realize that group is a reserved word for MySQL and that this problem is solved. Remember how painful it is to understand.

Reserved fields for MySQL

In MySQL, the words in the following table are explicitly preserved. Most of these digital systems are used by standard SQL as column names and/or table names (for example, GROUP). A few are preserved because MySQL needs them, in MySQL, when the table or field name and the database name and the reserved word conflict, in the SQL statement can be enclosed in an apostrophe (), when we generally try to minimize the use of these reserved fields.

ADD All Alter
ANALYZE and As
Asc Asensitive Before
BETWEEN BIGINT BINARY
Blob BOTH By
Call CASCADE Case
Change CHAR CHARACTER
CHECK COLLATE COLUMN
CONDITION CONNECTION CONSTRAINT
CONTINUE CONVERT CREATE
CROSS Current_date Current_time
Current_timestamp Current_User CURSOR
DATABASE DATABASES Day_hour
Day_microsecond Day_minute Day_second
DEC DECIMAL DECLARE
DEFAULT Delayed DELETE
DESC DESCRIBE Deterministic
DISTINCT Distinctrow Div
DOUBLE DROP DUAL
each ELSE ELSEIF
Enclosed Escaped EXISTS
EXIT EXPLAIN FALSE
FETCH FLOAT FLOAT4
FLOAT8 For FORCE
FOREIGN From Fulltext
Goto GRANT GROUP
Having High_priority Hour_microsecond
Hour_minute Hour_second IF
IGNORE In INDEX
INFILE INNER INOUT
Insensitive INSERT Int
INT1 INT2 INT3
INT4 INT8 INTEGER
INTERVAL Into Is
Iterate JOIN KEY
KEYS KILL LABEL
Leading LEAVE Left
Like LIMIT LINEAR
LINES LOAD LocalTime
Localtimestamp LOCK LONG
Longblob Longtext LOOP
Low_priority MATCH Mediumblob
Mediumint Mediumtext Middleint
Minute_microsecond Minute_second MOD
Modifies NATURAL Not
No_write_to_binlog Null NUMERIC
On OPTIMIZE OPTION
Optionally OR Order
Out OUTER OutFile
PRECISION PRIMARY PROCEDURE
PURGE RAID0 RANGE
READ Reads Real
REFERENCES Regexp Release
RENAME REPEAT REPLACE
REQUIRE RESTRICT Return
REVOKE Right Rlike
SCHEMA SCHEMAS Second_microsecond
SELECT Sensitive SEPARATOR
SET Show SMALLINT
SPATIAL Specific Sql
SQLEXCEPTION SQLSTATE SQLWarning
Sql_big_result Sql_calc_found_rows Sql_small_result
Ssl Starting Straight_join
TABLE Terminated THEN
Tinyblob TINYINT Tinytext
To Trailing TRIGGER
TRUE UNDO UNION
UNIQUE UNLOCK UNSIGNED
UPDATE USAGE Use
USING Utc_date Utc_time
Utc_timestamp VALUES VARBINARY
VARCHAR Varcharacter Varying
When WHERE While
With WRITE X509
Xor Year_month Zerofill

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.