Posts

Showing posts from June, 2014

Oracle: SQL to count record in all tables

If you want to know the record in all the tables from your database, can simply use this SQL command.

SELECT table_name,
               TO_NUMBER(extractvalue(xmltype(dbms_xmlgen.getxml('select count(*) c from ' || table_name)), '/ROWSET/ROW/C')) count
FROM user_tables
ORDER BY table_name;

Credit to https://community.oracle.com/thread/927598