回 帖 发 新 帖 刷新版面

主题:查询数据库问题

select * from workthings_use,userinf where workthings_use.putoutusername='' and (workthings_use.auditingflag=0 or (workthings_use.auditingflag=1 and workthings_use.alreadyauditing=1)) and workthings_use.writeuserid=userinf.ID

在这段话中加入workthings_use.putoutusername=''查询找不到任何结果
请问应该怎么写啊? 谢谢了

回复列表 (共3个回复)

沙发

是不是字段workthings_use.putoutusername没有空值,能否描述的再清楚点

板凳

我用的是MS SQL Server 数据库
我想查询的就是当workthings_use.putoutusername=""时的所有数据
并且 这个表中的workthings_use.putoutusername确实是空的 但是查不到

3 楼

workthings_use.putoutusername=''
改为
workthings_use.putoutusername is null
试试

我来回复

您尚未登录,请登录后再回复。点此登录或注册