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

IFNULL  与 ISNULL

 

Mysql库中使用ifnull进行判断,

SqlServer中则使用isnull.

 

例如:

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

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

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

posted @ 2014-06-18 15:49  闫晓盼  阅读(508)  评论(0编辑  收藏  举报