+ -
当前位置:首页 → 问答吧 → 看看这个SQL错在哪?

看看这个SQL错在哪?

时间:2011-11-27

来源:互联网

SQL code

select t.*, t.rowid from tb_onlinesetup t where sgkszy is null


可以查到数据
SQL code

select t.*, t.rowid from tb_onlinesetup t where
sgkszy=(case when sgkszy is not null then '普通员工' else null end) 


查不到数据
不知错在哪里,请高手指教,谢谢

作者: wsxcy66668888   发布时间: 2011-11-27

顶一下

作者: wsxcy66668888   发布时间: 2011-11-27

is null 和 =null 是两个概念~ 空和null不是相等的~ 
查询前可以判断一下~

作者: yjytiantang   发布时间: 2011-11-27

那如何改这个语句呢,使查询结果能一致

作者: wsxcy66668888   发布时间: 2011-11-27

再次顶起

作者: wsxcy66668888   发布时间: 2011-11-27