Updated on 2025-06-30 GMT+08:00

Keywords

The constraint differences are as follows:

  • If a keyword is a reserved one in GaussDB but non-reserved in MySQL, it cannot be a table name, column name, column alias, AS column alias, AS table alias, table alias, function name, or variable name in GaussDB, but can be any of these names or aliases in MySQL.
  • If a keyword is a non-reserved one in GaussDB but reserved in MySQL, it can be a table name, column name, column alias, AS column alias, AS table alias, table alias, function name, or variable name in GaussDB, but cannot be any of these names or aliases in MySQL.
  • If a keyword is a reserved one (function or type) both in GaussDB and MySQL, it can be a column alias, AS column alias, function name, or variable name in GaussDB, but cannot be any of these names or aliases in MySQL.
  • If a keyword is a reserved one (function or type) in GaussDB but non-reserved in MySQL, it cannot be a table name, column name, AS table alias, or table alias in GaussDB, but can be one of these names or aliases in MySQL.
  • If a keyword is a non-reserved one (excluding function and type) in GaussDB but reserved in MySQL, it can be a table name, column name, column alias, AS column alias, AS table alias, table alias, function name, or variable name in GaussDB, but cannot be any of these names or aliases in MySQL.
  • If a keyword is a non-reserved one (excluding function and type) both in GaussDB and MySQL, it cannot be a function name in GaussDB, but can be a function name in MySQL.

    Among non-reserved keywords, reserved keywords (functions or types), and non-reserved keywords (not functions or types) in GaussDB, the following keywords cannot be column aliases:

    BETWEEN, BIGINT, BLOB, CHAR, CHARACTER, CROSS, DEC, DECIMAL, DIV, DOUBLE, EXISTS, FLOAT, FLOAT4, FLOAT8, GROUPING, INNER, INOUT, INT, INT1, INT2, INT3, INT4, INT8, INTEGER, JOIN, LEFT, LIKE, LONGBLOB, LONGTEXT, MEDIUMBLOB, MEDIUMINT, MEDIUMTEXT, MOD, NATURAL, NUMERIC, OUT, OUTER, PRECISION, REAL, RIGHT, ROW, ROW_NUMBER, SIGNED, SMALLINT, SOUNDS, TINYBLOB, TINYINT, TINYTEXT, VALUES, VARCHAR, VARYING, and WITHOUT.

    SIGNED and WITHOUT can be used as column aliases in MySQL.