Oracle
 sql >> Database >  >> RDS >> Oracle

Ottieni i conteggi di tutte le tabelle in uno schema

Questo può essere fatto con una singola istruzione e un po' di magia XML:

select table_name, 
       to_number(extractvalue(xmltype(dbms_xmlgen.getxml('select count(*) c from '||owner||'.'||table_name)),'/ROWSET/ROW/C')) as count
from all_tables
where owner = 'FOOBAR'