Select * from tb where b is null or C is null or b='' or c=''
select * from 表名 where c is not null and b is not null
Select * from tb where b is not null or C is not null
Select * from tb where ISNULL(b,'')='' OR ISNULL(C,'')=''
create table #tb (a int,b int)insert into #tb select 1,2 union all select 23,89 union all select 4,null union all select null,55 union all select null,null union all select 66,677select * from #tb select * from #tb where a is not null and b is not null
好像我没说清楚。。 我最终要的记录集如下: A B C 1 2 3 4 2 3 5 2 3 B和C未空的都不要了
Select * from tb where ISNULL(b,'')<>'' OR ISNULL(C,'')<>''
Select * from tb where b is null or C is null
from 表名
where c is not null and b is not null
create table #tb (a int,b int)insert into #tb
select 1,2 union all
select 23,89 union all
select 4,null union all
select null,55 union all
select null,null union all
select 66,677select *
from #tb
select *
from #tb
where a is not null and b is not null
我最终要的记录集如下:
A B C
1 2 3
4 2 3
5 2 3
B和C未空的都不要了