气人!查找某一字段为空的SQL语句在SQL SERVER中可用,到ORACLE中就不灵了。

rtdb 2003-04-24 05:54:51
SELECT * from table1 where name = ''

以上语句在SQL SERVER工作正常, 在ORACLE中取不到数据。

那么在ORACLE中应怎么写呢?
...全文
62 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
bushland 2003-04-25
  • 打赏
  • 举报
回复
'' 和NULL在oracle中不是一个概念,‘’表示字段值 为空字符串,null表示字段没有赋值
rtdb 2003-04-25
  • 打赏
  • 举报
回复
谢谢大家。
pengdali 2003-04-25
  • 打赏
  • 举报
回复
oracle 和 sqlserver 不同

'' 等于 null

你用

SELECT * from table1 where name is null

就可以了,另在sqlserver中null也是用:

SELECT * from table1 where name is null

来查找
pengdali 2003-04-25
  • 打赏
  • 举报
回复
SELECT * from table1 where name = '' or name is null
David017 2003-04-24
  • 打赏
  • 举报
回复
sql server 中null和''也不是一个东西啊。。。
where name=null在sqlserver中才工作吧
where name='' 返回的不是name是null的

3年前是这样, 好久没用了
随便说说,,
对错都别给我分

NULL<>0 && NULL<>''

瓜哥makey 2003-04-24
  • 打赏
  • 举报
回复
Oracle中''与NULL不是一个东西。用SELECT * from table1 where name is null
arvid_gs 2003-04-24
  • 打赏
  • 举报
回复
SELECT * from table1 where length(name)= 0
arvid_gs 2003-04-24
  • 打赏
  • 举报
回复
SELECT * from table1 where name is null
tomew 2003-04-24
  • 打赏
  • 举报
回复
结贴吧
tomew 2003-04-24
  • 打赏
  • 举报
回复
SELECT * from table1 where name is null
数据的世界 2003-04-24
  • 打赏
  • 举报
回复
select * from table1 where name<>NULL 行不行?

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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