Re: Select Question - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Select Question
Date
Msg-id 20040202190638.GA8386@svana.org
Whole thread Raw
In response to Select Question  (Alex <alex@meerkatsoft.com>)
Responses Re: Select Question  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
List 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@svana.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

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Return Value of a Function
Next
From: Terry Lee Tucker
Date:
Subject: Re: Return Value of a Function