(File under: Posts that were meant to be but never were)
- COALESCE() – the ANSI standard
- ISNULL() – the Microsoft T-SQL standard (only takes two values)
- IFNULL() – the MySQL standard (only takes two values)
- NVL() – Oracle / Informix PL/SQL standard (only takes two values)
Got that from a message board.
Basically it takes a query result, and in order of the parameters, if the first is NULL, then it uses the second parameter (often a string or ‘N/A’ or whatever.
SQL Server: Coalesce()
SQL Server: Isnull()
Kind of useful when you want to munge strings — because anything + NULL is always null, you can avoid that by doing
COALESCE(TABLE.WHATEVER,”)+ ‘anything’