-
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.
-
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
-
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
-
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;
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|