HOW TO SELECT COUNT(*) FROM MULTIPLE TABLES IN ORACLE SQLs

Try this query to count total rows from multiple tables at once

kish@exdbx<>select count(*) from TABX
union all
select count(*) from SALES_TAB
union all
select count(*) from AFTERDROP
union all
select count(*) from SALES_TAB_COPY_TEMP
union all
select count(*) from SALES_TAB_COPY
union all
select count(*) from SALES_MV
union all
select count(*) from DEMO_DUP
union all
select count(*) from SALES_T
union all
select count(*) from SALES;  2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17

                                COUNT(*)
----------------------------------------
                                 1048576
                                 1398102
                                    4000
                                  349526
                                 1398102
                                 1048576
                                 2000001
                                 1048576
                                 4000002

9 rows selected.

Leave a Reply