标签:函数 col rom lse sql coalesce sele ble oal
处理NULL值 - 数据库中某列为NULL值,使用函数在列值为NULL时返回固定值。
SQLServer:ISNULL(col,value)
示例:SELECT ISNULL(col,value) FROM tableName
Oracle:NVL(col,value)
示例:SELECT NVL(col,value) FROM tableName
MySQL:IFNULL(col,value)、COALESCE(col,value)
示例:SELECT IFNULL(col,value) FROM tableName
SELECT COALESCE(col,value) FROM tableName
标签:函数 col rom lse sql coalesce sele ble oal
原文地址:https://www.cnblogs.com/it-mh/p/12035912.html