What I Learned About SQL on August 7, 2004
(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)
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+ ‘anything

No comments
Comments feed for this article
Trackback link
http://artlung.com/blog/2004/02/08/107628244934476261/trackback/