문제

I have written a Stored procedure in which in given table column named xx can have 0,1 or null. When I give the below condition. SP is ignoring null and returning data only for 0 value.

WHERE (CAR_INSPECTION_NEW_TEST.NODAMAGEFLAG is null OR
       CAR_INSPECTION_NEW_TEST.NODAMAGEFLAG = 0) AND
       CAR_INSPECTION_NEW_TEST.ISSUBJECT_TODELIVER = 0

Can any one tell what is the problem?

도움이 되었습니까?

해결책

By simple logic it will not return rows where NODAMAGEFLAG is null as long as ISSUBJECT_TODELIVER = 0 is not also valid (because of the AND).

So, check your data please.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top