22,209
社区成员
发帖
与我相关
我的任务
分享
select * from tb where c<>''
/*
id c
----------- -----------
*/
select * from tb where c is not null
/*
id c
----------- -----------
1
*/
create table tb(id int,c varchar(10))
insert tb select 1,'' union all select 8,null
select * from tb where c=''
/*
id c
----------- -----------
1
*/
select * from tb where c is null
/*
id c
----------- -----------
8 NULL
*/
set ansi_nulls on
select * from tb where c=null
/*
id c
----------- -----------
*/
set ansi_nulls off
select * from tb where c=null
/*
id c
----------- -----------
8 NULL
*/
drop table tb