以下 Query 的实际结果为 NULL
select semid from programvariantterm where programvariantid = 240
但是当我尝试以下语句时,它给出了 0 行:
declare @semid int
set @semid = -1
select semid from programvariantterm
where programvariantid = 240 and semid = nullif(@semid,-1)
以下 Query 的实际结果为 NULL
select semid from programvariantterm where programvariantid = 240
但是当我尝试以下语句时,它给出了 0 行:
declare @semid int
set @semid = -1
select semid from programvariantterm
where programvariantid = 240 and semid = nullif(@semid,-1)