Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Count(*) each table from user_tables
Here is a script which created a set of sqlplus statements which give the
table_name and count(*) of each table from dba_tables for a particular
schema_name. You can modify this to get each table in user_tables. Just
spool the output and run it in sqlplus or cut and paste it and run it.
select 'select '''||table_name||''' , count(*) from
schema_owner.'||table_name||';'
from dba_tables where owner='SCHEMA_OWNER';
HTH,
Ruth Gramolini
Oracle DBA
Vermont Department of Taxes
Phone 802-828-5708
Email rgramolini_at_tax.state.vt.us <mailto:rgramolini_at_tax.state.vt.us>
-----Original Message-----
From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Mihalis I. Tsoukalos
Sent: Friday, July 02, 2004 2:33 AM
To: Oracle Mailing List
Subject: Count(*) each table from user_tables
Dear list,
I have the following question:
I want to count(*) every table from users_table table using SQL. I know how to do it in PL/SQL but not in SQL. Can you please help me do it?
many thanks in advance,
Mihalis.
--
09:31:15 up 12 days, 22:35, 2 users, load average: 0.04, 0.03, 0.06