The actual result of the following Query is NULL
select semid from programvariantterm where programvariantid = 240
But when I try the following statement, it gives 0 rows:
declare @semid int
set @semid = -1
select semid from programvariantterm
where programvariantid = 240 and semid = nullif(@semid,-1)
I think you’re confusing
NULLIFandISNULLa little bit.Your statement would work with the following
ISNULL: