Is there a opposite function to ISNULL in sql server? To do Is not null?

前端 未结 8 1685
悲哀的现实
悲哀的现实 2021-01-01 08:53

I have this code in my select statement

ISNULL(a.PolicySignedDateTime,aq.Amount) AS \'Signed Premium\',

But I want to see if \"a.PolicySign

8条回答
  •  粉色の甜心
    2021-01-01 09:22

    There is the COALESCE expression (although not function https://msdn.microsoft.com/en-us/library/ms190349.aspx) test the arguments in order and keep doing it until finds the value not NULL and returns it.

    example usage:
    SELECT COALESCE(NULL, NULL, 5)--returns 5

    In your case :
    COALESCE(a.PolicySignedDateTime,aq.Amount) AS 'Signed Premium',

提交回复
热议问题