How to Use Coalesce

The coalesce function returns the first non null parameter, which is a sort of isnull function. Using the previous table test, we can do:

Select name2, coalesce(name2 , 'xxxxxx') coalesce from test;
name2 coalesce
John John
Peter Peter
null xxxxxx

IN THIS PAGE