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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie SQL Question

Re: Newbie SQL Question

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 26 Jul 2007 23:57:32 -0700
Message-ID: <1185519450.390363@bubbleator.drizzle.com>


chunji08_at_gmail.com wrote:
> Hi there,
> I have a sql question, if someone can help.
>
> Let's say there is a table called "table_map", which has two columns,
> "tablename" and "sql_mapping". If I say:
> " select tablename from table_map where sql_mapping is not null.", I
> will get a list of tables that exist in the same database.
>
> Besides, if I say: "select count(*) from <table name>", I will get the
> rows in one table.
>
> So my Question is is there a way I can combine both SQLs into one,
> that returns me the counts of each table, and the table_names from the
> "table_map".
>
>
> Thanks a lot for the tips.
>
>
> Charlie.

Depending on version a number of solutions. If 10g I'd be inclined to test a WITH clause.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Jul 27 2007 - 01:57:32 CDT

Original text of this message

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