Counting no. of records from multiple tables; Oracle DB

后端 未结 2 1844
忘掉有多难
忘掉有多难 2021-01-20 06:02

I know i need to use this query to get the list of tables for a schema: select table_name from all_tables where owner=\'schema\'

I know the following query counts t

2条回答
  •  被撕碎了的回忆
    2021-01-20 06:19

    The table ALL_TABLES contains the column NUM_ROWS. (You can get a description of the table with the following SQL statement: DESCRIBE ALL_TABLES;)

    The following statement shows the number of records for every table:

    SELECT TABLE_NAME, NUM_ROWS FROM ALL_TABLES WHERE OWNER='SCHEMA';
    

    To get the number of records in all tables of your schema, use:

    SELECT SUM(NUM_ROWS) FROM ALL_TABLES WHERE OWNER='SCHEMA';
    

提交回复
热议问题