如何检查值IS NULL [or] = @param(@param为空)
IS NULL [or] = @param
前任:
Select column1 from Table1 where column2 IS NULL => works fine
如果我想将比较值(IS NULL)替换为@param。如何才能做到这一点
Select column1 from Table1 where column2 = @param => this works fine until @param got some value in it and if is null never finds a record.
如何实现?
select column1 from Table1 where (@param is null and column2 is null) or (column2 = @param)