0

我有以下必须返回结果的请求:

select ass.* 
from CTR_ASSURANCE ass 
inner join CTR_ARTICLEASSURANCE ca on ass.CODE_CONTRAT = ca.CODE_CONTRAT
WHERE  
   (GETDATE() between ass.DATE_DEBUT and ass.DATE_FIN)
   and ass.resilie <> 1 
   and ca.CODE_ARTICLE = 39

在数据库中有一行满足这个条件但是请求没有返回任何结果,问题出在ass.resilie <> 1. 此列是数字,所有行都有“resilie”空帮助请

4

1 回答 1

1

You can use the IS operator to compare with NULL. Replace

ass.resilie<>1

with

(ass.resilie IS NULL OR ass.resilie <> 1)
于 2013-08-01T10:33:47.533 回答