pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shoaib Mir <shoaibmir@gmail.com>
To: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
Cc: Bart Degryse <Bart.Degryse@indicator.be>
Cc: pgsql-sql@postgresql.org
Subject: Re: Duplicate records
Date: Fri, 2 Feb 2007 19:03:08 +0500
Message-ID: <bf54be870702020603v11f08a1ep3ac546eba4a37a00@mail.gmail.com> (raw)
In-Reply-To: <55c095e90702020559t27296667g5a46aca1b5386679@mail.gmail.com>
References: <55c095e90702020548h4c5ae5b2h405a2a33fb5b950@mail.gmail.com>
	<45C350D8.A3DD.0030.0@indicator.be>
	<55c095e90702020559t27296667g5a46aca1b5386679@mail.gmail.com>

Where do you see the second table in it?

I guess here:

A = mytable
B = (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 <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 by
> > field1, field2 having count(*) > 1) B
> > where A.field1 = B.field1 and A.field2 = 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 of my
> > table.
> >
> > Any help would be welcomed.
> >
> > --
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> >                                   Atenciosamente (Sincerely)
> >                         Ezequias Rodrigues da Rocha
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> >
> > A pior das democracias ainda é melhor do que a melhor das ditaduras
> > The worst of democracies is still better than the better of
> > dictatorships
> > http://ezequiasrocha.blogspot.com/
> >
>
>
>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>                                   Atenciosamente (Sincerely)
>                         Ezequias Rodrigues da Rocha
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> A pior das democracias ainda é melhor do que a melhor das ditaduras
> The worst of democracies is still better than the better of dictatorships
> http://ezequiasrocha.blogspot.com/

view thread (9+ messages)  latest in thread

Message-ID: <bf54be870702020603v11f08a1ep3ac546eba4a37a00@mail.gmail.com>
Permalink:  ../bf54be870702020603v11f08a1ep3ac546eba4a37a00@mail.gmail.com/
Also on:    postgresql.org/message-id/bf54be870702020603v11f08a1ep3ac546eba4a37a00@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: shoaibmir@gmail.com, ezequias.rocha@gmail.com, Bart.Degryse@indicator.be
  Subject: Re: Duplicate records
  In-Reply-To: <bf54be870702020603v11f08a1ep3ac546eba4a37a00@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox