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: distinct(object_type) from dba_objects in SQL

Re: distinct(object_type) from dba_objects in SQL

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Fri, 10 Dec 1999 14:12:18 GMT
Message-ID: <38510A42.C8156501@edcmail.cr.usgs.gov>


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

Original text of this message

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