MySql保留关键字查询列表
程序员文章站
2021-12-20 21:39:44
...
由于我博客以前是准备写一个论坛的、后来发现论坛备案过不了、后来改为博客、但是数据库的表名仍然没有改、做为一个有强迫症的程序员、这必须得改、改的时候查一下MySql的保留关键字、记录一下、以便以后使用
在使用MySQL的时候、一般尽量避免用关键字作为表名、如使用关键字做表名、需要按标准写法给SQL语句加[](或是“)区分字段名和表名、下面列出MySQL所有关键字、希望给使用MySQL的朋友提供一些参考帮助
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 |
MySQL允许部分关键字用做未引起来的识别符、因为许多人以前曾使用过它们、下面列出了一些例子:ACTION、BIT、DATE、ENUM、NO、TEXT、TIME、TIMESTAMP、另外还有一个上面没有说的count也不能使用
上一篇: ZipArchive类解压缩zip文件
推荐阅读
-
mysql多个关键字的查询解决思路
-
PHP使用mysql_fetch_row查询获得数据行列表的方法,phpmysql_fetch_row_PHP教程
-
MySQL单表多关键字模糊查询的实现方法
-
MySQL单表多关键字模糊查询的实现方法
-
PHP+Mysql+jQuery查询和列表框选择操作实例讲解
-
MySQL 5.7中的关键字与保留字详解
-
MySql带OR关键字的多条件查询语句
-
MySQL 数据库查询数据,过滤重复数据保留一条数据---(MySQL中的row_number变相实现方法)
-
C# ASP.NET+MySQL数据库命名了1个long字段,和C#的保留字重名,并且和MySQL数据库的关键字重名,如何用Parameters.AddWithValue方法插入新记录到数据库
-
MySQL带LIKE关键字的查询