2013年10月11日 星期五

Oracle 顯示所有表格的資料筆數

Oracle 顯示所有表格的資料筆數可用下列SQL:

select table_name,
to_number(
  extractvalue(
     xmltype(
       dbms_xmlgen.getxml(
         'select count(*) c from ||table_name)
             )
             ,'/ROWSET/ROW/C'
               ) 
          ) count
from user_tables

沒有留言:

張貼留言