Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: NewBie : SQL Problem..
You can use dynamic sql or, as others wrote, use the "analyze table" command and
then look at the num_rows of each table in "user_tables".
Like this:
analyze table <table> compute statistics;
insert into table table_d (table_name, row_count) select table_name, num_rows from user_tables where table_name in ( <table names>);
-Eric
ashesh48_at_my-dejanews.com wrote:
> Hi,
> I have a problem with counts.
> I have 3 tables.. wtiht the following no.of rows in it..
> table name count(rows)
> ------------------- ------------------
> A 25
> B 5
> C 10
>
> Now i want to create another table (D) which can have the following coulumns..
> Columns
> 1. Table name
> 2. Counts.
>
> Out put.. sholud be as follow...
> table name counts.
> ---------------- ----------
> A 25
> B 5
> C 10
> I am not able to get the query.. for that. Please help...
>
> Thanks in advance for you help..
>
> Ashesh.
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
Received on Fri May 29 1998 - 11:19:28 CDT
![]() |
![]() |