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: identical columns

Re: identical columns

From: <interld808_at_aol.com>
Date: Wed, 09 Sep 1998 19:21:19 GMT
Message-ID: <6t6kfe$20t$1@nnrp1.dejanews.com>


In article <01bddbfd$5f3ec540$a049100a_at_pc743-sode.seurope.ikea.com>,   "Corinna Becker" <Corinna.Becker_at_removethis.memo.ikea.com> wrote:
> Hello,
> I have the following problem: I have a table of which I know that it
> contains duplicate rows. I want to find all rows that are duplicate.
> How can I do that?
> Regards and thanks
> Corinna Becker
>

Try this:

SELECT DISTINCT(t.id_field) id_field
  FROM table1 t

         , (SELECT id_field, count(id_field) countem
                FROM table1
                GROUP BY id_field)  x
  WHERE  t.id_field = x.id_field
        AND x.countem > 1;

Anybody else have a more efficient way?

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Wed Sep 09 1998 - 14:21:19 CDT

Original text of this message

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