Keywords
Contents
Keywords#
Reserved and Unreserved Keywords#
This page introduces OpenMLDB keywords, distinguishes reserved keywords/non-reserved keywords, and summarizes keywords for query use.
Keywords are words with special meanings in SQL statements, such as SELECT
, UPDATE
, DELETE
, etc. Keywords are case-insensitive.
Keywords include reserved and non-reserved words:
Unreserved Keyword: Can be used directly as an identifier, which is called Unreserved Keyword (abbreviated as Unreserved Word).
Reserved keywords: Special treatment is a requirement - words that can be used as identifiers with `` match brackets are called reserved keywords (referred to as reserved words).
Reserved words must be enclosed in backticks `` to be used as identifiers. For example: JOIN is a reserved word defined by OpenMLDB, the following statement cannot run successfully:
CREATE TABLE JOIN (a INT);
Syntax error: Unexpected keyword JOIN [at 1:14]
CREATE TABLE JOIN (a INT);
^
You need to use backticks to wrap it into `JOIN`
, JOIN can be used as an identifier:
CREATE TABLE `JOIN` (a INT);
SUCCEED: Create successfully
For non-reserved words, they can also be used as identifiers without special treatment. For example: DATA is a non-reserved word, then the following statement can run successfully:
CREATE TABLE DATA (a INT);
SUCCEED: Create successfully
Keyword Summary#
The following table lists all the keywords in OpenMLDB. The reserved words are marked with (R)
.
A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z
A#
ABORT
ACCESS
ACTION
ADD
AGGREGATE
ALL®
ALTER
ANALYZE
AND®
ANONYMIZATION
ANY®
ARRAY®
AS®
ASC®
ASSERT
ASSERT_ROWS_MODIFIED®
AT®
B#
BATCH
BEGIN
BETWEEN®
BIGDECIMAL
BIGNUMERIC
BREAK
BY®
C#
CALL
CASCADE
CASE®
CAST®
CHECK
CLAMPED
CLUSTER
COLLATE®
COLUMN
COLUMNS
COMMIT
CONFIG®
CONNECTION
CONST
CONSTANT
CONSTRAINT
CONTAINS®
CONTINUE
CLONE
CREATE®
CROSS®
CUBE®
CURRENT®
CURRENT_TIME
D#
DATA
DATABASE
DATE
DATETIME
DECIMAL
DECLARE
DEFAULT®
DEFINE®
DEFINER
DELETE
DEPLOY
DEPLOYMENT
DESC®
DESCRIBE
DESCRIPTOR
DETERMINISTIC
DISTINCT®
DIV®
DO
DROP
E#
ELSE®
ELSEIF
END®
ENFORCED
ENUM®
ERROR
ESCAPE®
EXCEPT®
EXCEPTION
EXCLUDE®
EXECUTE
EXISTS®
EXPLAIN
EXPORT
EXTERNAL
EXTRACT®
F#
FALSE®
FETCH®
FILTER
FILTER_FIELDS
FILL
FIRST
FOLLOWING®
FOR®
FOREIGN
FORMAT
FROM®
FULL®
FUNCTION
G#
GENERATED
GLOBAL
GRANT
GROUP®
GROUP_ROWS
GROUPING®
GROUPS®
H#
HASH®
HAVING®
HIDDEN
I#
IF®
IGNORE®
IMMEDIATE
IMMUTABLE
IMPORT
IN®
INCLUDE
INOUT
INDEX®
INFILE
INNER®
INSERT
INSTANCE_NOT_IN_WINDOW®
INTERSECT®
INTERVAL®
ITERATE
INTO®
INVOKER
IS®
ISOLATION
J#
JOB
JOIN®
JSON
K#
KEY
L#
LANGUAGE
LAST®
LATERAL®
LEAVE
LEFT®
LEVEL
LIKE®
I#
ILIKE®
L#
LIMIT®
LOAD
LOOKUP®
LOOP
M#
MATCH
MATCHED
MATERIALIZED
MAX
MAXSIZE
MESSAGE
MIN
MOD®
MODEL
MODULE
MERGE®
N#
NATURAL®
NEW®
NO®
NOT®
NULL®
NULLS®
NUMERIC
O#
OF®
OFFSET
ON®
ONLY
OPEN®
OPTIONS
OR®
ORDER®
OUT
OUTFILE
OUTER®
OVER®
P#
PARTITION®
PERCENT
PIVOT
U#
UNPIVOT
P#
POLICIES
POLICY
PRIMARY
PRECEDING®
PROCEDURE
PRIVATE
PRIVILEGES
PROTO®
PUBLIC
Q#
QUALIFY
R#
RAISE
RANGE®
READ
RECURSIVE®
REFERENCES
RENAME
REPEAT
REPEATABLE
REPLACE
REPLACE_FIELDS
RESPECT®
RESTRICT
RETURN
RETURNS
REVOKE
RIGHT®
ROLLBACK
ROLLUP®
ROW
ROWS®
ROWS_RANGE®
RUN
S#
SAFE_CAST
SCHEMA
SEARCH
SECURITY
SELECT®
SESSION
SET®
SHOW
SIMPLE
SOME®
SOURCE
STORING
STOP
SQL
STABLE
START
STATUS
STORED
STRUCT®
SYSTEM
SYSTEM_TIME
T#
TABLE
TABLESAMPLE®
TARGET
TEMP
TEMPORARY
THEN®
TIME
TIMESTAMP
TO®
TRANSACTION
TRANSFORM
TREAT®
TRUE®
TRUNCATE
TYPE
U#
UNBOUNDED®
UNION®
UNNEST®
UNIQUE
UNTIL
UPDATE
USE
USING®
V#
VALUE
VALUES
VARIABLES
VOLATILE
VIEW
VIEWS
W#
WEIGHT
WHEN®
WHERE®
WHILE
WINDOW®
WITH®
WITHIN®
WRITE
X#
XOR®
Z#
ZONE