select *,tmp=isnull(字段4,'') from table1 where tmp='' --仅是用法,空值直接用1楼
select * from table1 where ISNULL(字段4, '') = ''
select * from table1 where 字段4 is null
SELECT * FROM table1 WHERE 字段4 is null
select * from table1 where 字段4 is null
select * from table1 where 字段4 is null
三、SET ANSI_NULLS当 SET ANSI_NULLS 为 ON 时,所有对空值的比较均取值为 UNKNOWN。当 SET ANSI_NULLS 为 OFF 时,如果数据值为 NULL,则所有数据对空值的比较将取值为 TRUE。如果未指定,则应用当前数据库的 ANSI nulls 选项的设置。另外,当该选项为真是,必须使用is null条件来判断一个列是否包含null值;当这个选项为假时,sql server中=null等价于is null,<>null 等价于is not null。
select *,tmp=isnull(字段4,'') from table1 where tmp='' --仅是用法,空值直接用1楼
select * from table1 where 字段4 is null
FROM table1
WHERE 字段4 is null
select * from table1 where 字段4 is null
select * from tb where 字段4 is null