偶一般是用2步:
select 'select '''||table_name
||''', case when count(*)=1 then 999999 else 0 end from '
||table_name ||' where rownum=1; '
from user_tables
where rownum<10
/
执行上述sql生成的sql,执行过虑999999 即可;如果经常做表分析,直接从user_tables.NUM_ROWS中获得。
select 'select '''||table_name
||''', case when count(*)=1 then 999999 else 0 end from '
||table_name ||' where rownum=1; '
from user_tables
where rownum<10
/
执行上述sql生成的sql,执行过虑999999 即可;如果经常做表分析,直接从user_tables.NUM_ROWS中获得。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货