刚刚做了一个测试,数据库中有记录3,345,257条:语句一,执行时间40.07秒
select * from tb_city_outport_detail_fnl
where (dep_date='2002-07-01' or dep_date='2002-07-02' or dep_date='2002-07-03')
and (air_code='HU' or air_code='SC' or air_code='2Z' or air_code='CA')语句二,执行时间39.03秒
select * from tb_city_outport_detail_fnl
where dep_date in ('2002-07-01','2002-07-02','2002-07-03')
and air_code in ('HU','SC','2Z','CA') 执行结果为1824条,从测试结果上看,效率几乎差不多。
select * from tb_city_outport_detail_fnl
where (dep_date='2002-07-01' or dep_date='2002-07-02' or dep_date='2002-07-03')
and (air_code='HU' or air_code='SC' or air_code='2Z' or air_code='CA')语句二,执行时间39.03秒
select * from tb_city_outport_detail_fnl
where dep_date in ('2002-07-01','2002-07-02','2002-07-03')
and air_code in ('HU','SC','2Z','CA') 执行结果为1824条,从测试结果上看,效率几乎差不多。
解决方案 »
- 在函数中调用存储过程
- 关于oracle中的PL/SQL模糊查询的问题
- 求助oracle储存过程问题?
- 虚心请教:将ORACLE9.2存储过程转换为sqlserver2000存储过程
- 查询问题(+)
- PL/SQL中如何把comments的内容查找后都列出来?
- 求p3095277_9204_LINUX.zip的下载地址,谢了
- 大侠帮忙!!用imp导入时怎样才能不含有数据,只有结构?
- oracle安装时的jdk问题
- 请教:如何任意设定时间将一个表中的清空,然后从另外一个表中复制过来,用job?怎么用!!
- 怎么样才能在节点上启动Intelligent Agent!各位大虾请帮帮忙!
- 请问如何取表中的前X个记录,就是说TOP如何用?
.. = ..
union all
... = ..
union all
... = ..试一试?