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

Comparison Functions

Table 1 Comparison functions

MySQL

GaussDB

Difference

COALESCE()

Supported, with differences.

In the union distinct scenario, the precision of the return value is different from that in MySQL.

If there is an implicit type conversion error in the subsequent parameter expression of the first parameter that is not NULL, MySQL ignores the error while GaussDB displays a type conversion error. When the parameter is a MIN or MAX function, the return value type is different from that in MySQL.

INTERVAL()

Supported.

-

GREATEST()

Supported, with differences.

For binary return values, MySQL offers various options (including BINARY, VARBINARY, and BLOB), while GaussDB offers only one—LONGBLOB. For non-binary return values, MySQL offers various options (including CHAR, VARCHAR, and TEXT), while GaussDB only offers TEXT.

If the input parameter of the function contains NULL and the function is called after the WHERE keyword, the returned result is inconsistent with that of MySQL 5.7. This problem lies in MySQL 5.7. Since MySQL 8.0 has resolved this problem, GaussDB are consistent with MySQL 8.0.

LEAST()

Supported, with differences.

For binary return values, MySQL offers various options (including BINARY, VARBINARY, and BLOB), while GaussDB offers only one—LONGBLOB. For non-binary return values, MySQL offers various options (including CHAR, VARCHAR, and TEXT), while GaussDB only offers TEXT.

If the input parameter of the function contains NULL and the function is called after the WHERE keyword, the returned result is inconsistent with that of MySQL 5.7. This problem lies in MySQL 5.7. Since MySQL 8.0 has resolved this problem, GaussDB are consistent with MySQL 8.0.

ISNULL()

Supported.

-