- Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Description
With NULL a first class citizen, we need to add NULL specific functions, some standard, some extensions, to ease its handling. This is a meta-ticket around the functions planned:
-
COALESCESQL: Implement COALESCE function #35060
The most generic form of null checking with fallback. -
IFNULL/ISNULL/NVL
2 argument variant ofCOALESCE(IFNULL is a MySQL variant and an ODBC system function, ISNULL is a MS-SQL server variant and NVL comes from Oracle).NVLin particular needs to pay attention to the Oracle semantics. -
NULLIF
Takes 2 arguments and returnsNULLif the 2 arguments are equal, otherwise it returns the 1st one. -
<=>or null-safe equals
This needs investigating as the standard SQL for it seems to beIS (NOT) DISTINCT FROM. H2 has a variation of itx IS (NOT) y.
MySQL variant is the most popular though. -
GREATEST/LEAST
Non-standard SQL but implemented by a number of DBs.