July 10, 2014

Coalesce function

If the field is null, the coalesce function can assign a default value:

select coalesce(type_desc, 'Unknown'), count(*)
from person
group by type_desc

No comments:

Post a Comment