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

Home -> Community -> Usenet -> c.d.o.tools -> Re: count for a newbie

Re: count for a newbie

From: Bryant Baecht <b_b_a_e_c_h_t_at_sun_flower.com>
Date: Mon, 18 Sep 2000 21:00:13 GMT
Message-ID: <ssd0j5s7tr7s2d@corp.supernews.com>

Hi Sybrand,

     I am wanting the count of the items in each table selected in the query: I.E.

doctaba has 349 items in it. ( select count(*) from doctaba ) user_table1 has 102434 items in it ( select count(*) from user_table1 ) user_table2 has 3096 items in it ( select count(*) from user_table2 )

Hopefully this is more insightful.

Bryant

In article <969307666.3779.1.pluto.d4ee154e_at_news.demon.nl>, "Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:
>What is the count referring to?
>The number of extents?
>The number of records?
>Which Oracle version are you using?
>(The answer will be different dependent on version, and it is too much work
>to provide two completely different solutions)
>
>Regards,
>
>Sybrand Bakker, Oracle DBA
>
>"Bryant Baecht" <b_b_a_e_c_h_t_at_sun_flower.com> wrote in message
>news:sscevccjh3t113_at_corp.supernews.com...
>> Hi all,
>> I want to select all segments from sys.dba_segments by a userid and
 do a
>> count on each table. My SQL looks something like this but it doesn't
 work.
>>
>> select segment_name,count(*) from sys.dba_segments where user='tom' group
 by
>> segment_name;
>>
>> What I want my output to look like is this:
>>
>> SEGMENT_NAME COUNT(*)
>> ----------------------------------------------
>>
>> doctaba 349
>> user_table1 102434
>> user_table2 3096
>>
>> ..
>>
>> Any quick pointers are definitely appreciated.
>>
>> TIA,
>>
>> Bryant
>>
>>
>>
>
>
Received on Mon Sep 18 2000 - 16:00:13 CDT

Original text of this message

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