0分?
用存储过程好办
建个游标,cursor t is select table_name from user_tables;
countsql varchar2(100);
begin
for t1 in t loop
countsql:='insert into temp select '''||table_name||''',count(*) from '||t1.table_name;
execute immediate countsql;
commit;
end loop;
在循环中用动态SQL统计每个表的COUNT(*),插入一个临时表,查询该TEMP就可以得到结果
用存储过程好办
建个游标,cursor t is select table_name from user_tables;
countsql varchar2(100);
begin
for t1 in t loop
countsql:='insert into temp select '''||table_name||''',count(*) from '||t1.table_name;
execute immediate countsql;
commit;
end loop;
在循环中用动态SQL统计每个表的COUNT(*),插入一个临时表,查询该TEMP就可以得到结果
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货