Skip site navigation (1) Skip section navigation (2)

Re: limited field duplicates

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Don Isgitt <djisgitt(at)soundenergy(dot)com>
Cc: postgresql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: limited field duplicates
Date: 2003-01-31 19:06:23
Message-ID: 21027.1044039983@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
Don Isgitt <djisgitt(at)soundenergy(dot)com> writes:
> I am trying to find rows in a table that are duplicates only in the 
> sense of certain columns; i.e, not all columns are the same, and then 
> for each duplicate entry, I want to retrieve one of the columns that is 
> not part of the duplication criteria.

Try SELECT DISTINCT ON.  There's a simple example in the SELECT
reference page (something about weather reports I think).

			regards, tom lane

In response to

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2003-01-31 19:09:02
Subject: Re: ALTER STATISTIC and dump ?
Previous:From: Tom LaneDate: 2003-01-31 19:00:15
Subject: Re: Query performance PLEASE HELP

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group