数据库记录查找问题 第一条语句都是全表扫描,速度是最慢的,我试了第二条语句,如果两个表xh都有索引,通过执行计划看到只能使用到tb_b的索引,所以你只能根据具体数据量的大小来选择子查询的表 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tb_a a,tb_b b where a.xh=b.xh(+) and b.xh is null; select * from tb_a where not exists(select xh from tb_b where tb_b.xh=tb_a.xh)给xh建索引试试,应该可以 select tb_a.*,tb_b.xh newxh from(select tb_a.*,tb_b.* from tb_a ,tb_b where tb_a.xh=tb_b.xh(+)) where newxh is null; 用左联接是否能快些?select tb_a.* from tb_a left outer join tb_b on tb_a.xh=tb_b.xh where tb_b.xh is null select * from tb_a,(select trim(xh) from tb_a minus select trim(xh) from tb_b) t where trim(tb_a.xh)=tmp.xh 一个简单的sql语句 数据库范式问题 出血分求解,问题如下! 有没有语句是重新编译存储过程的?? oracle 安装完后,怎么没management server服务 把数据从sqlserver导入到oracle后产生的严重问题。 export和RMAN的疑问(在线) 以Orcle为后台数据库,以下SQL语句出现了错误: 哪里有oracle for solaris x86的下载,高分谢过,不够还可以加! oracle 存储过程中参数问题 oralce9 for hp-ux 64bit 能不能安装到redhat2.1企业版上,急 安装oracle 安装问题!急! 急!急
where a.xh=b.xh(+)
and b.xh is null;
给xh建索引试试,应该可以
(select tb_a.*,tb_b.* from tb_a ,tb_b
where tb_a.xh=tb_b.xh(+)
)
where newxh is null;
select tb_a.* from tb_a left outer join tb_b on tb_a.xh=tb_b.xh where tb_b.xh is null