在SQL Server中:
select isnull(num,0) from table1 --如果num字段中的值为NULL时,将显示为0
而Access中的isnull函数,只是用来判断一个表达式或是字段是否Null,返回的是布尔值(True/False),但是结合iif函数时,可以实现与SQL Server等同的效果。
select iif(isnull(num),0,num) from table1
select name,iif(isnull(count(*)),0,count(*)) from table group by name