Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id C346C9FA42F for ; Fri, 2 Feb 2007 09:59:40 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 76184-09 for ; Fri, 2 Feb 2007 09:59:33 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by postgresql.org (Postfix) with ESMTP id 268279FA410 for ; Fri, 2 Feb 2007 09:59:32 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so682121ugf for ; Fri, 02 Feb 2007 05:59:31 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=W2KfL29zWoM1cQIqB5zI/xupmQD5x8H/efxTi9oNv5horbAh/Nwdch7tWLFd1NmOeTKRDmM44tkdc074ZnMe85bux60PVedvG1gRUCypxcGPNy7BV8f3+D9SJWRzkCW9V9zb5tjNSj9Pc/idDjS71VKl8h1sT7BaYSxWOCMSBco= Received: by 10.82.153.5 with SMTP id a5mr1192317bue.1170424770755; Fri, 02 Feb 2007 05:59:30 -0800 (PST) Received: by 10.66.217.13 with HTTP; Fri, 2 Feb 2007 05:59:30 -0800 (PST) Message-ID: <55c095e90702020559t27296667g5a46aca1b5386679@mail.gmail.com> Date: Fri, 2 Feb 2007 11:59:30 -0200 From: "Ezequias Rodrigues da Rocha" To: "Bart Degryse" Subject: Re: Duplicate records Cc: pgsql-sql@postgresql.org In-Reply-To: <45C350D8.A3DD.0030.0@indicator.be> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_20770_28619766.1170424770595" References: <55c095e90702020548h4c5ae5b2h405a2a33fb5b950@mail.gmail.com> <45C350D8.A3DD.0030.0@indicator.be> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/14 X-Sequence-Number: 27348 ------=_Part_20770_28619766.1170424770595 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thank you but are you talking of two tables ? I intent to check in only one table. Please explain to me. Ezequias 2007/2/2, Bart Degryse : > > select * > from mytable A, (select field1, field2, count(*) from mytable group by > field1, field2 having count(*) > 1) B > where A.field1 =3D B.field1 and A.field2 =3D B.field2 > > >>> "Ezequias Rodrigues da Rocha" 2007-02-02 > 14:48 >>> > Hi list, > > I am making some data minning and would like to know if someone tell me > how to retrieve the duplicate records based in one or two fields of my > table. > > Any help would be welcomed. > > -- > =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D > Atenciosamente (Sincerely) > Ezequias Rodrigues da Rocha > =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- > A pior das democracias ainda =E9 melhor do que a melhor das ditaduras > The worst of democracies is still better than the better of dictatorships > http://ezequiasrocha.blogspot.com/ > --=20 =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D Atenciosamente (Sincerely) Ezequias Rodrigues da Rocha =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- A pior das democracias ainda =E9 melhor do que a melhor das ditaduras The worst of democracies is still better than the better of dictatorships http://ezequiasrocha.blogspot.com/ ------=_Part_20770_28619766.1170424770595 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thank you but are you talking of two tables ? I intent to check in only one= table.

Please explain to me.

Ezequias

2007/2/2, Bart = Degryse < Bart.Degryse@indicator.be&= gt;:
select *
from mytable A, (select field1, field2, count(*) from mytable group by= field1, field2 having count(*) > 1) B
where A.field1 =3D B.field1 and A.field2 =3D B.field2

>>&= gt; "Ezequias Rodrigues da Rocha" < ezequias.rocha@gmail.com> 2007-02-02 14:48 >>>

Hi list,

I am making some = data minning and would like to know if someone tell me how to retrieve the = duplicate records based in one or two fields of my table.

Any help would be welcomed.

--
=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
    =             &nb= sp;            =      Atenciosamente (Sincerely)
  &nb= sp;            =          Ezequias Rodrigues da= Rocha
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- <= br>A pior das democracias ainda =E9 melhor do que a melhor das ditadurasThe worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blo= gspot.com/



--
=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D
      = ;            &n= bsp;            = ;   Atenciosamente (Sincerely)
    &n= bsp;            = ;       Ezequias Rodrigues da Rocha
=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D= -
A pior das democracias ainda =E9 melhor do que a melhor das ditaduras<= br>The worst of democracies is still better than the better of dictatorship= s
http://ezequiasrocha.blo= gspot.com/ ------=_Part_20770_28619766.1170424770595--