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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s