Using Coalesce

Posted by Derek Dieter on SQL Server Planet See other posts from SQL Server Planet or by Derek Dieter
Published on Sun, 13 Jun 2010 23:19:05 +0000 Indexed on 2010/06/13 23:24 UTC
Read the original article Hit count: 220

Filed under:
The coalesce function is used to find the first non-null value. The function takes limitless number of parameters in order to evaluate the first non null. If all the parameters are null, then COALESCE will also return a NULL value.-- hard coded example SELECT MyValue = COALESCE(NULL, NULL, 'abc', 123)The example above returns back [...]

© SQL Server Planet or respective owner

Related posts about sql