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

Home -> Community -> Usenet -> c.d.o.server -> Re: Simple Query Help....

Re: Simple Query Help....

From: <fitzjarrell_at_cox.net>
Date: 10 Oct 2006 13:28:18 -0700
Message-ID: <1160512098.252813.125810@m73g2000cwd.googlegroups.com>


Comments embedded.
amerar_at_iwc.net wrote:
> Hey All,
>
> I just need a bit of help with this query. I want to select all of the
> duplicate synonym names in the database.

A simple group by query with a having clause works here:

select synonym_name
from dba_synonyms
group by synonym_name
having count(*) > 1;

>However, I want to list not
> just the synonym name, but also the owner of the synonym
> name............
>

So? You can't think far enough ahead to use the above query as a list generator for an IN clause? Obviously not, given this is no different from your usual posts

select owner, synonym_name
from dba_synonyms
where synonym_name in ( select synonym_name

                                       from dba_synonyms
                                       group by synonym_name
                                       having count(*) > 1)
order by synonym_name, owner;

Reading the problem is half of the battle. Are the schools teaching less while charging more, or is the clientelle to which they cater increasingly lazy?

David Fitzjarrell Received on Tue Oct 10 2006 - 15:28:18 CDT

Original text of this message

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