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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Select nonDistinct?

Re: Select nonDistinct?

From: Nascar <nascar_at_flash.net>
Date: Sat, 09 Sep 2000 15:36:32 GMT
Message-ID: <4Osu5.801$oc3.77345@news.flash.net>

if ID is the column you want to see dupes for:

select id from dasilva_table
group by id having count(*) > 1

"Luiz da Silva" <big57arf_at_optonline.com> wrote in message news:BGiu5.1236$En.524404_at_news02.optonline.net...
> Hi all,
>
> My first question to the group.
>
> I know that I can use Select Distinct ... to return non-duplicate rows in
 a
> table, but is there any way to bring back only the rows that are
 duplicated.
> By this I mean, suppose my table looks something like this:
>
> id_number name
> 1 Lou da Silva
> 2 Fred da Silva
> 1 Alan da Silva
> 3 Figaro da Silva
> 4 Felix da Silva
> 2 Pendejo da Silva
>
> SELECT DISTINCT Id_Number FROM Dasilva_Table;
>
> will bring back
>
> id_number
> 1
> 2
> 3
> 4
>
> What I would like to do is something like this:
>
> SELECT NONDISTINCT Id_Number FROM Dasilva_Table;
>
> and get back:
>
> id_number
> 1
> 2
>
> Thanks in advance and thanks for all the help you've provided indirectly
 to
> me by replying to other people's questions.
>
>
>
>
>
>
Received on Sat Sep 09 2000 - 10:36:32 CDT

Original text of this message

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