保留字

最近更新时间:2022-09-15 16:28:52

我的收藏

注意事项

如果这几种标识符是下面的保留字作为数据库名、表名、列名、函数名、视图名等标识符的时候,需要加上默认的转义符:
标识符:` 反引号

例如: hour -> `hour`

create table `hour` (
id string,
`asc` int
)

hour、asc 为关键字,此时如果需要创建这样的列就必须带上反引号进行创建。

关键保留字

A

ALL
ALTER
AND
ANY
AS
AUTHORIZATION

B

BETWEEN
BOTH
BY

C

CALL
CASE
CAST
CHECK
CLUSTER
COLLATE
COLUMN
CONSTRAINT
CREATE
CROSS
CUBE
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
CURRENT_USER
CURSOR

D

DEALLOCATE
DEFAULT
DELETE
DESCRIBE
DISTINCT
DISTRIBUTE
DROP

E

ELSE
END
ESCAPE
EXCEPT
EXECUTE
EXISTS
EXPLAIN
EXTRACT

F

FETCH
FILTER
FOR
FOREIGN
FROM
FULL
FALSE

G

GRANT
GROUP
GROUPING

H

HAVING

I

IN
INNER
INSERT
INTERSECT
INTERVAL
INTO
IS

J

JOIN

L

LATERAL
LEADING
LEFT
LIKE
LIMIT
LOCALTIME
LOCALTIMESTAMP

M

MERGE
MINUS

N

NATURAL
NEW
NEXT
NORMALIZE
NOT
NULL

O

OFFSET
ON
ONLY
OR
ORDER
OUTER
OVER
OVERLAPS

P

PARTITION
PATTERN
PERCENTILE_CONT
PERCENTILE_DISC
PERMUTE
PREPARE
PRIMARY

R

RANGE
RECURSIVE
REFERENCES
RIGHT
ROLLUP
ROW
ROWS

S

SELECT
SEMI
SESSION_USER
SET
SOME

T

TABLE
THEN
TIME
TO
TRAILING
TRUE

U

UESCAPE
UNION
UNIQUE
UNKNOWN
UNNEST
UPDATE
USER
USING

V

VALUES

W

WHEN
WHERE
WINDOW
WITH
WITHIN