Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: distinct(object_type) from dba_objects in SQL
I like it! But won't it give multiple object_type counts? For example,
if Owner SCOTT has 3 tables and owner JOE has 5 tables, then the output
will look like
SCOTT TABLE 3
SCOTT VIEW 2 JOE TABLE 5 JOE VIEW 11
What if the poster wants
TABLE 8 ?
VIEW 19
Then try:
SELECT OBJECT_TYPE,count(OBJECT_NAME)
FROM DBA_OBJECTS
where OWNER NOT IN ('SYS','SYSTEM','DB_SNMP','PUBLIC','DBSNMP')
GROUP BY OBJECT_TYPE;
HTH,
Brian
mnma_at_my-deja.com wrote:
>
> How about this you dope
>
> > select OWNER, OBJECT_TYPE, count(OBJECT_NAME)
> from DBA_OBJECTS
> where OWNER NOT IN ('SYS','SYSTEM','DB_SNMP','PUBLIC','DBSNMP')
> group by OWNER, OBJECT_TYPE
> order by 1 asc, 2 asc
>
> Mike
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Fri Dec 10 1999 - 08:12:18 CST