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: Laurenz Albe <invite_at_spam.to.invalid>
Date: 26 Jul 2007 14:07:33 GMT
Message-ID: <1185458851.903676@proxy.dienste.wien.at>


Maxim Demenko <mdemenko_at_arcor.de> wrote:
>>>> 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".

>>> sure, go ahead & do it.
>> 
>> Big words, little evidence.
>> I doubt that you can do this in one SQL query.
> 
> Just one remark - it can be done in single sql query as demonstrated here
> http://laurentschneider.com/wordpress/2007/04/how-do-i-store-the-counts-of-all-tables.html
> I don't think however, it can have practical value, rather academical, 
> nevertheless, the approach used by Laurent looks very nice.

Ok, I stand corrected. But I learned something :^)

Laurenz Albe Received on Thu Jul 26 2007 - 09:07:33 CDT

Original text of this message

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