DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: urgent : Need SQL help

Hybrid View

  1. #1
    Join Date
    Jan 2001
    Posts
    230
    Hi

    How can I get the following results? I am concern with how to get the total of distict object_type along with object_name and object_type.

    OBJECT_NAME OBJECT_TYPE
    ------------------------------ ------------------
    T1 TABLE
    T2 TABLE
    T3 TABLE
    T4 TABLE
    --------------
    Total=4
    I1 INDEX
    I2 INDEX
    -------------
    Total=2

    Following query gives me object_name and object_type but not total along with object_type and object_name..
    select object_name,object_type
    from user_objects
    group by object_name,object_type
    order by object_type

    Thanks.

  2. #2
    Join Date
    Sep 2000
    Posts
    384
    The object_name will be unique for each owner so the count will always be one only ...

    If you want the total object_type by owner then

    select owner,object_type,count(*) from dba_objects group by
    owner,object_type ;
    Radhakrishnan.M

  3. #3
    Join Date
    Jan 2001
    Posts
    230

    Thanks for reply..

    But, I want total count for distinct object_type...
    e.g.
    I want object_name,object_type for table then Total No. of table after that object_name,object_type for index then total No. of Indexes..

    Thanks





  4. #4
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    break on object_type;
    compute count of object_name on object_type;

    select object_type, object_name from dba_objects
    where owner = 'YOU_OWNER'
    order by 1;



  5. #5
    Join Date
    Jan 2001
    Posts
    230
    Shestakov,

    Thanks...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width