Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id D09369FA22A for ; Fri, 2 Feb 2007 10:03:34 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 98766-09 for ; Fri, 2 Feb 2007 10:03:11 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.235]) by postgresql.org (Postfix) with ESMTP id BE4529FA15F for ; Fri, 2 Feb 2007 10:03:10 -0400 (AST) Received: by nz-out-0506.google.com with SMTP id i11so834333nzh for ; Fri, 02 Feb 2007 06:03:09 -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=akDUBVE+l9CC78qe7rZTRrWRL5DU/jahF7pfICnTEzxjPD92652jzrv07HdZxV179BMzjDlaylV42c3xVz8SkDSbfYW71MftGhnmSloj9jEfOyDIUqQGPxEvap92+woEVrk2kAQsGYxY0vNDDR2CXjvKZAM4ya0x1ihcdnUOKEI= Received: by 10.65.211.13 with SMTP id n13mr5963904qbq.1170424988781; Fri, 02 Feb 2007 06:03:08 -0800 (PST) Received: by 10.65.206.17 with HTTP; Fri, 2 Feb 2007 06:03:08 -0800 (PST) Message-ID: Date: Fri, 2 Feb 2007 19:03:08 +0500 From: "Shoaib Mir" To: "Ezequias Rodrigues da Rocha" Subject: Re: Duplicate records Cc: "Bart Degryse" , pgsql-sql@postgresql.org In-Reply-To: <55c095e90702020559t27296667g5a46aca1b5386679@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_15841_23404504.1170424988729" References: <55c095e90702020548h4c5ae5b2h405a2a33fb5b950@mail.gmail.com> <45C350D8.A3DD.0030.0@indicator.be> <55c095e90702020559t27296667g5a46aca1b5386679@mail.gmail.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/15 X-Sequence-Number: 27349 ------=_Part_15841_23404504.1170424988729 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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, field2 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 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 by > > 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-0= 2 > > 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/ > > > > > > -- > =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_15841_23404504.1170424988729 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 fie= ld1, field2 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.

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/

------=_Part_15841_23404504.1170424988729--