Updated on 2024-05-14 GMT+08:00

SQL

GaussDB is compatible with most MySQL syntax, but there are some differences. This section describes the MySQL syntax supported by GaussDB.

Some keywords can be used as identifiers in MySQL, but cannot or are restricted to be identifiers in M-compatible mode, as listed in Keywords restricted to be identifiers.
Table 1 Keywords restricted to be identifiers

Keyword Type

Keyword

Constraint

Reserved (Type or function is allowed.)

COLLATION and COMPACT

They cannot be used as identifiers in other databases except for functions and variables.

Non-reserved (Type or function is not allowed.)

BIT, BOOLEAN, COALESCE, DATE, NATIONAL, NCHAR, NONE, NUMBER, TEXT, TIME, TIMESTAMP, and TIMESTAMPDIFF

They cannot be used as identifiers for functions or variables.

Reserved

ANY, ARRAY, BUCKETS, DO, END, LESS, MODIFY, OFFSET, ONLY, RETURNING, SOME, and USER

They cannot be used as identifiers in any database.