Re: Select Question

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Alex <alex(at)meerkatsoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Select Question
Date: 2004-02-02 19:06:38
Message-ID: 20040202190638.GA8386@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

See DISTINCT ON()

On Tue, Feb 03, 2004 at 12:22:29AM +0900, Alex wrote:
> Hi,
> I need to remove duplicate records from a table like
>
> Code Date
> XS111111 2004-01-26
> XS111111 2003-01-22
> XS222222 2004-02-01
> XS222222 2004-01-26
> XS222222 2003-01-22
>
> where only the newest record of Code XSxxxxxxx is kept in the table. Is
> there an easy way to do that?

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Terry Lee Tucker 2004-02-02 19:31:10 Re: Return Value of a Function
Previous Message Tom Lane 2004-02-02 18:58:33 Re: Return Value of a Function