广州研库信息技术有限公司 Copyright@2018广州研库信息技术有限公司 Copyright@2018
2
练习题-1 下面两个SQL的写法有什么问题, 高效的写法是?
各练习题使用的表(t2相同):
create table t1 as select * from dba_objects;
create index idx_t1_created on t1(created);
--sql1:
select count(*) from t1 where created-1/24>sysdate;
--sql2:
select count(*) from t1
where to_char(created,'yyyymmdd')='20200620';
评论