Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How to? - Count number of rows in all tables
I want to do something which I believed would be simple, but I'm stumped.
I would like to count the number of rows in each of the tables owned by a certain user :
If the following database existed:
FRED:
TableA 10 rows
TableB 155 rows
JIM:
TableC 4243 rows
TableD 32 rows
and I wanted to query "How many rows are there in each of the tables owned by fred"... I'd want something like:
TableName RowCount _________ ________ TableA 10 TableB 155
It seems I need to be able to perform something like the following...
select tname TableName, count(*) RowCount from ?!!? where ?!!? in (select tname from tab);
I don't care if I have to use packages, views or whatever - please help if you can.
I feel the need for dynamic SQL - am I right ? - I've never used it before.
--
Paul Smith
Technical Manager, SDR Systems Ltd
Please change Compuserve.comz to Compuserve.com to respond via Email
Received on Tue May 26 1998 - 10:42:44 CDT