Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to Find Total Rows by Owner
For a static option you could do:
select sum(ct) from
(
select count(*) ct from table1
union all
select count(*) from table2
union all
....
union all
select count(*) from tableNNNN
)
;
--
Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk
Mike J McCall wrote in message <7cpgfs$dan$1_at_nnrp1.dejanews.com>...
>Is there any way to find the total number of rows in all the tables for one
>owner ? In other words, how can I do an SQL "select count(*) from
>table1,table2,table3,...' that prints one number representing the combined
>number of rows in all tables?
>
>I don't think a join or union is the answer. I also tried a cursor in
PL/SQL
>that dynamically selects individual counts from each table, but this won't
>compile because the tablename cannot be a variable. I am looking to use the
>total number of rows as a simple aggregate metric for all owned tables.
>
>Any ideas thanks in advance.
>
>
>Software Developer from the Past
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Thu Mar 18 1999 - 15:58:28 CST
![]() |
![]() |