以下為MySQL保留字,不能使用下列名稱作為表格名稱或欄位名稱,其中大多數和ANSI SQL92相同,一些保留原因是因為MySQL中使用yacc的語法分析器,若使用函式名稱作為表格/欄位名稱,則函式後接著的"("中間不可空白。
ADD | ALL | ALTER | ANALYZE | AND |
AS | ASC | AUTO_INCREMENT |
|
|
BDB | BEFORE | BERKELEYDB | BETWEEN | BIGINT |
BINARY | BLOB | BOTH | BTREE | BY |
CASCADE | CASE | CHANGE | CHAR | CHARACTER |
CHECK | COLLATE | COLUMN | COLUMNS | CONSTRAINT |
CREATE | CROSS | CURRENT_DATE | CURRENT_TIME | CURRENT_TIMESTAMP |
DATABASE | DATABASES | DAY_HOUR | DAY_MINUTE | DAY_SECOND |
DEC | DECIMAL | DEFAULT | DELAYED | DELETE |
DESC | DESCRIBE | DISTINCT | DISTINCTROW | DIV |
DOUBLE | DROP |
|
|
|
ELSE | ENCLOSED | ERRORS | ESCAPED | EXISTS |
EXPLAIN |
|
|
|
|
FALSE | FIELDS | FLOAT | FOR | FORCE |
FOREIGN | FROM | FULLTEXT | FUNCTION |
|
GRANT | GROUP |
|
|
|
HASH | HAVING | HIGH_PRIORITY | HOUR_MINUTE | HOUR_SECOND |
IF |
|
|
|
|
IGNORE | IN | INDEX | INFILE | INNER |
INNODB | INSERT | INT | INTEGER | INTERVAL |
INTO | IS |
|
|
|
JOIN |
|
|
|
|
KEY | KEYS | KILL |
|
|
LEADING | LEFT | LIKE | LIMIT | LINES |
LOAD | LOCALTIME | LOCALTIMESTAMP | LOCK | LONG |
LONGBLOB | LONGTEXT | LOW_PRIORITY |
|
|
MASTER_SERVER_ID | MATCH | MEDIUMBLOB | MEDIUMINT | MEDIUMTEXT |
MIDDLEINT | MINUTE_SECOND | MOD | MRG_MYISAM | NATURAL |
NOT | NULL | NUMERIC | ON | OPTIMIZE |
OPTION | OPTIONALLY | OR | ORDER | OUTER |
OUTFILE |
|
|
|
|
PRECISION | PRIMARY | PRIVILEGES | PROCEDURE | PURGE |
READ | REAL | REFERENCES | REGEXP | RENAME |
REPLACE | REQUIRE | RESTRICT | RETURNS | REVOKE |
RIGHT | RLIKE | RTREE |
|
|
SELECT | SET | SHOW | SMALLINT | SOME |
SONAME | SPATIAL | SQL_BIG_RESULT | SQL_CALC_FOUND_ROWS | SQL_SMALL_RESULT |
SSL | STARTING | STRAIGHT_JOIN | STRIPED |
|
TABLE | TABLES | TERMINATED | THEN | TINYBLOB |
TINYINT | TINYTEXT | TO | TRAILING | TRUE |
TYPES |
|
|
|
|
UNION | UNIQUE | UNLOCK | UNSIGNED | UPDATE |
USAGE | USE | USER_RESOURCES | USING |
|
VALUES | VARBINARY | VARCHAR | VARCHARACTER | VARYING |
WARNINGS | WHEN | WHERE | WITH | WRITE |
XOR | YEAR_MONTH | ZEROFILL |
|
|
以下的符號(來自上表)是被 ANSI SQL 禁止的,但是可以被 MySQL 用於列/表名
ACTION
BIT
DATE
ENUM
NO
TEXT
TIME
TIMESTAMP
沒有留言:
張貼留言