Re: Duplicate records

From: "Ezequias Rodrigues da Rocha" <ezequias(dot)rocha(at)gmail(dot)com>
To: "Shoaib Mir" <shoaibmir(at)gmail(dot)com>
Cc: "Bart Degryse" <Bart(dot)Degryse(at)indicator(dot)be>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Duplicate records
Date: 2007-02-02 15:00:53
Message-ID: 55c095e90702020700v4e84c5e7n4e8116645c67a5af@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 <shoaibmir(at)gmail(dot)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(dot)rocha(at)gmail(dot)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(dot)Degryse(at)indicator(dot)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(dot)rocha(at)gmail(dot)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/
>
>
>

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andrew Sullivan 2007-02-02 15:16:44 Re: Duplicate records
Previous Message Hiltibidal, Robert 2007-02-02 14:56:36 Re: Insert into a date field