数据库中判断为空后使用默认值的函数

数据库中判断为空后使用默认值的函数

IFNULL  与 ISNULL

Mysql库中使用ifnull进行判断,

SqlServer中则使用isnull.

例如:

对应库中的test表中如果count为null,则返回,否则返回count的值。

Mysql:select ifnull(count,0) from test ;

SqlServer:select isnull(count,0) from test;