查询语句: select t.* from V_Storage_Bill t where t.storage_bill_billcode not in (
select a.fee_optcode from Settlement_Fee a );
查不到数据,但是将子查询换成如下
select t.* from V_Storage_Bill t where t.storage_bill_billcode not in (‘ttttt’);
可以查到数据,纠结。。
难道视图中不能有子查询吗。
select a.fee_optcode from Settlement_Fee a );
查不到数据,但是将子查询换成如下
select t.* from V_Storage_Bill t where t.storage_bill_billcode not in (‘ttttt’);
可以查到数据,纠结。。
难道视图中不能有子查询吗。
解决方案 »
- 小问题,求解答!急
- 问个有关时间问题的sql语句
- 大家都有分!oracle forms连接数据库问题
- ORA-01114: 将块写入文件 6 时出现 IO 错误
- [在线等]请问unix下oracle权限问题
- 急求解决方案:使用toad连接远程oracle服务器时,出现ora-12154:tns:无法处理服务名错误
- oracle存储过程中的临时表错误
- 请教如何将SQL查询出的数据改变颜色高亮显示
- select a.* from db1an a where db1_1 in
- 关于Oracle 8 中的BLOB字段的容量问题
- 急,高分求解oracle10G安装双实例问题,解决后即上来结贴给分
- 序列是某用户独有的吗
select a.fee_optcode from Settlement_Fee a ); 也查得到数据44条,视图中存在162条,不知道为什么
select t.*
from V_Storage_Bill t left join
Settlement_Fee a on t.storage_bill_billcode=a.fee_optcode
where a.fee_optcode is null
SELECT 1 FROM dual WHERE '1' NOT IN (SELECT NULL FROM dual)
就没有查询结果,因为null特殊,不能和任何值匹配,解决方案,第2种方法最好
1:SELECT 1 FROM dual WHERE '1' NOT IN (SELECT nvl(NULL, ' ') FROM dual)2:NOT EXISTS
select t.* from V_Storage_Bill t where NOT EXISTS(
select 0 from Settlement_Fee a WHERE t.storage_bill_billcode = a.fee_optcode );