1 数据准备
drop table test1;
drop table test2;
create table test1 as select * from dba_objects;
alter table test1 add constraint pk_test1 primary key (object_id);
create table test2 as select * from dba_objects;
insert into test2 select * from test2;
insert into test2 select * from test2;
commit;
2 优化分析
2.1 写法一
select t1.object_id,t1.object_name,t1.OWNER,
t1.object_type,t1.namespace,t1.created,
sum(t2.data_object_id) as sum_id