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: Maxim Demenko <mdemenko_at_arcor.de>
Date: Thu, 26 Jul 2007 10:48:55 +0200
Message-ID: <46A85FF7.4030103@arcor.de>


Laurenz Albe schrieb:
> Ana C. Dent <anacedent_at_hotmail.com> 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.
>
> Besides I think that this is a bad idea at all.
> If any of the tables are large, this will take long and do a lot of I/O.
>
> Yours,
> Laurenz Albe

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.

Best regards

Maxim Received on Thu Jul 26 2007 - 03:48:55 CDT

Original text of this message

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