Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 0CD3A9FA4CD for ; Fri, 2 Feb 2007 11:01:11 -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 84761-10 for ; Fri, 2 Feb 2007 11:01:02 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.242]) by postgresql.org (Postfix) with ESMTP id A62D29FA15F for ; Fri, 2 Feb 2007 11:01:02 -0400 (AST) Received: by an-out-0708.google.com with SMTP id c24so550980ana for ; Fri, 02 Feb 2007 07:01:01 -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=ER5lVy6+qW2Ooxsgsat66pf6TzOmn+JfpuXbq4l7V09mKP2TiQlBJ/wBPgKwS94lgSV9f7FAnpSyTcRjRp9/wzwtTHRW+C0pmvYnZZTYWCbkQMAf7kRFH+NYwsGOfIEg4pXuhBbKuAqnaVB+8Fz3RXQCPjahrPfoSQcKKKhgtgU= Received: by 10.49.107.8 with SMTP id j8mr6621879nfm.1170428453809; Fri, 02 Feb 2007 07:00:53 -0800 (PST) Received: by 10.66.217.13 with HTTP; Fri, 2 Feb 2007 07:00:53 -0800 (PST) Message-ID: <55c095e90702020700v4e84c5e7n4e8116645c67a5af@mail.gmail.com> Date: Fri, 2 Feb 2007 13:00:53 -0200 From: "Ezequias Rodrigues da Rocha" To: "Shoaib Mir" Subject: Re: Duplicate records Cc: "Bart Degryse" , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21958_10872689.1170428453297" References: <55c095e90702020548h4c5ae5b2h405a2a33fb5b950@mail.gmail.com> <45C350D8.A3DD.0030.0@indicator.be> <55c095e90702020559t27296667g5a46aca1b5386679@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.041 tagged_above=0 required=5 tests=AWL, BAYES_50, HTML_50_60, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200702/18 X-Sequence-Number: 27352 ------=_Part_21958_10872689.1170428453297 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline You are correct. Sorry my mistake. The SQL statement is correct and I find the duplicate records. ps: I just think postresql could make this easyly. Don't you think ? Any function or anything else. Thank you so much. Ezequias 2007/2/2, Shoaib Mir : > > Where do you see the second table in it? > > I guess here: > > A =3D mytable > B =3D (select field1, field2, count(*) from mytable group by field1, fiel= d2 > having count(*) > 1) > > So that is all around one table that is 'mytable', where A and B are just > the aliases. > > -- > Shoaib Mir > EnterpriseDB (www.enterprisedb.com) > > On 2/2/07, Ezequias Rodrigues da Rocha < ezequias.rocha@gmail.com> wrote: > > > > 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>: > > > > > > select * > > > from mytable A, (select field1, field2, count(*) from mytable group b= y > > > field1, field2 having count(*) > 1) B > > > where A.field1 =3D B.field1 and A.field2 =3D B.field2 > > > > > > >>> "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 o= f 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/ > > > > > > > > > > > -- > > =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_21958_10872689.1170428453297 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline You are correct. Sorry my mistake. The SQL statement is correct and I find = the duplicate records.

ps:= I just think postresql could make this easyly. Don't you think ? Any f= unction or anything else.

Thank you so much.

Ezequias

2007/2/2, Shoaib Mir <shoaibmir@gmail.com >:
W= here do you see the second table in it?

I guess here:

A =3D m= ytable
B =3D (select field1, field2, count(*) from mytable group by field1, fi= eld2 having count(*) > 1)

So that is all around one table that is= 'mytable', where A and B are just the aliases.

--
Shoaib Mir
EnterpriseDB (www.enterprisedb.com)

On 2/2/07, E= zequias Rodrigues da Rocha < ezequias.rocha@gmail.com> wrote:
Thank you but are you talking of two tables ? = I intent to check in only one table.

Please explain to me.

Eze= quias

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 s= omeone tell me how to retrieve the duplicate records based in one or two fi= elds 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/




--
=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 d= a 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_21958_10872689.1170428453297--