我正在尝试在列列表中搜索记录,其中至少有一列具有空值或没有值。我使用下面的sql,但它只返回空值的记录,但不返回没有值的记录。
从表中选择firstname,lastname,address1,address2,postcode,其中firstname + lastname + address1 + address2 + postcode = null
感谢您提前的时间:)
答案 0 :(得分:1)
select firstname, lastname, address1, address2, postcode
from table
where isnull(firstname,'')='' or isnull(lastname,'') ='' or isnull(address1,'') ='' or isnull(address2,'')='' or isnull(postcode,'')) =''