关于NULL的问题

yeerh 2005-10-06 07:26:47
我想查找某一列为空的所有记录..
如:select * from tatal where address=null
为什么总是没有返回结果....明明address列为空的有很多..
还有address=address+"string",如果address为NULL...则无返加值??
...全文
129 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
MorningTea 2005-10-06
  • 打赏
  • 举报
回复
为NULL要这样判断

select * from tatal where address is null

相对有is not null
用=null肯定查不出资料,因为null和任何运算因子运算都是null ,1=null就是null

还有address=address+"string",---〉这个不知道你说什么
点点星灯 2005-10-06
  • 打赏
  • 举报
回复

--try
select * from tatal where address is null


select address=isnull(address,'')+"string" from tatal where address is null

34,593

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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