sql server 中是否有与 ISNULL 相反的函数?是不是null? [英] Is there a opposite function to ISNULL in sql server? To do Is not null?
本文介绍了sql server 中是否有与 ISNULL 相反的函数?是不是null?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的选择语句中有这段代码
I have this code in my select statement
ISNULL(a.PolicySignedDateTime,aq.Amount) AS 'Signed Premium',
但我想看看a.PolicySignedDateTime"是否不为空.是否有一个简单的函数可以做到这一点,而不涉及使用if"语句?
But I want to see if "a.PolicySignedDateTime" is not null. Is there a easy function to do this which does not involve using a "if" statement?
大家加油
推荐答案
必须使用CASE
SELECT CASE WHEN Field IS NOT NULL
THEN 'something'
ELSE 'something else'
END
这篇关于sql server 中是否有与 ISNULL 相反的函数?是不是null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文