Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: NewBie : SQL Problem..

Re: NewBie : SQL Problem..

From: Eric Lyders-Gustafson <ericlg_at_homemail.com>
Date: Fri, 29 May 1998 11:19:28 -0500
Message-ID: <356EE010.4C1FB8EA@homemail.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US