Conflict between MySQL field names and reserved words and Solutions

Source: Internet
Author: User
Conflicts between MySQL field names and reserved words often occur in actual operations. The following errors may occur. Com. mysql. jdbc. exceptions. jdbc4.MySQLSyntaxErrorExcep

Conflicts between MySQL field names and reserved words often occur in actual operations. The following errors may occur. Com. mysql. jdbc. exceptions. jdbc4.MySQLSyntaxErrorExcep

Problem: Conflicts between MySQL field names and reserved words often occur in actual operations, and the following errors may occur.

Com. mysql. jdbc. exceptions. jdbc4.MySQLSyntaxErrorException.

Solution: in MySQL, the words in the following table are explicitly retained. Most numeric statements are used as column names and/or table names (for example, GROUP) by standard SQL statements ). A few are retained because MySQL requires them. In MySQL, when the table name, field name, or Database Name Conflict with the reserved word, you can use the marker () in the SQL statement, these reserved fields should be used as few as possible.

ADDALLALTER

ANALYZEANDAS

ASCASENSITIVEBEFORE

BETWEENBIGINTBINARY

BLOBBOTHBY

CALLCASCADECASE

Changecharacter

CHECKCOLLATECOLUMN

CONDITIONCONNECTIONCONSTRAINT

CONTINUECONVERTCREATE

CROSSCURRENT_DATECURRENT_TIME

CURRENT_TIMESTAMPCURRENT_USERCURSOR

DATABASEDATABASESDAY_HOUR

DAY_MICROSECONDDAY_MINUTEDAY_SECOND

DECDECIMALDECLARE

DEFAULTDELAYEDDELETE

DESCDESCRIBEDETERMINISTIC

DISTINCTDISTINCTROWDIV

DOUBLEDROPDUAL

EACHELSEELSEIF

ENCLOSEDESCAPEDEXISTS

EXITEXPLAINFALSE

FETCHFLOATFLOAT4

FLOAT8FORFORCE

FOREIGNFROMFULLTEXT

GOTOGRANTGROUP

HAVINGHIGH_PRIORITYHOUR_MICROSECOND

HOUR_MINUTEHOUR_SECONDIF

IGNOREININDEX

INFILEINNERINOUT

INSENSITIVEINSERTINT

INT1INT2INT3

INT4INT8INTEGER

INTERVALINTOIS

ITERATEJOINKEY

KEYSKILLLABEL

LEADINGLEAVELEFT

LIKELIMITLINEAR

LINESLOADLOCALTIME

LOCALTIMESTAMPLOCKLONG

LONGBLOBLONGTEXTLOOP

LOW_PRIORITYMATCHMEDIUMBLOB

MEDIUMINTMEDIUMTEXTMIDDLEINT

MINUTE_MICROSECONDMINUTE_SECONDMOD

MODIFIESNATURALNOT

NO_WRITE_TO_BINLOGNULLNUMERIC

ONOPTIMIZEOPTION

OPTIONALLYORORDER

OUTOUTEROUTFILE

PRECISIONPRIMARYPROCEDURE

PURGERAID0RANGE

READREADSREAL

REFERENCESREGEXPRELEASE

RENAMEREPEATREPLACE

REQUIRERESTRICTRETURN

REVOKERIGHTRLIKE

SCHEMASCHEMASSECOND_MICROSECOND

SELECTSENSITIVESEPARATOR

SETSHOWSMALLINT

SPATIALSPECIFICSQL

SQLEXCEPTIONSQLSTATESQLWARNING

SQL _BIG_RESULTSQL_CALC_FOUND_ROWSSQL_SMALL_RESULT

SSLSTARTINGSTRAIGHT_JOIN

TABLETERMINATEDTHEN

TINYBLOBTINYINTTINYTEXT

TOTRAILINGTRIGGER

TRUEUNDOUNION

UNIQUEUNLOCKUNSIGNED

UPDATEUSAGEUSE

USINGUTC_DATEUTC_TIME

UTC_TIMESTAMPVALUESVARBINARY

VARCHARVARCHARACTERVARYING

WHENWHEREWHILE

WITHWRITEX509

XORYEAR_MONTHZEROFILL

-------------------------------------- Split line --------------------------------------

Install MySQL in Ubuntu 14.04

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

MySQL-5.5.38 universal binary Installation

-------------------------------------- Split line --------------------------------------

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.