紧急求助~~~~~~~~~~~!

chenshicss 2010-03-18 11:38:36
请问一下各位高手!
T-SQL里怎么去掉记录中有'NULL'的数据啊!
或者怎么查询记录中没有'NULL'的数据啊
...全文
65 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
永生天地 2010-03-18
  • 打赏
  • 举报
回复
is null
is not null
heruoyong 2010-03-18
  • 打赏
  • 举报
回复
SELECT * FROM TableName WHERE col IS NOT NULL
dawugui 2010-03-18
  • 打赏
  • 举报
回复
[Quote=引用楼主 chenshicss 的回复:]
请问一下各位高手!
T-SQL里怎么去掉记录中有'NULL'的数据啊!
或者怎么查询记录中没有'NULL'的数据啊
[/Quote]
--字段为null
select * from tb where col is null
select * from tb where col is not null

--字符串里面含有'null'
select * from tb where charindex('null' , col) > 0

select * from tb where col like '%null%'
SQL77 2010-03-18
  • 打赏
  • 举报
回复
select * from tb where ISNULL(COL,'')=''
--小F-- 2010-03-18
  • 打赏
  • 举报
回复
select * from tb where col is null

22,209

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧