22,297
社区成员
发帖
与我相关
我的任务
分享--自身左连接 ,查询 is null记录。
select a.* from tb a left join tb b on a.[col1]=b.[col1] where b.[col1] is nullset ansi_null off
select * from tb where col1 <> null and col2 <> null .....set ansi_null on
select * from tb where col1 is not null and col2 is not null .....
where cast(col as sql_variant)
+cast(co2 as sql_variant)
+cast(co3 as sql_variant)
is not null
where col is not null and col !=''

col1 is not null and col2 is not null and col3 is not null--1
where col is not null
--2
where col !=''
--3
where col is not null and col !-''