Re: point types in "DISTINCT" queries - Mailing list pgsql-general

From Jeff Davis
Subject Re: point types in "DISTINCT" queries
Date
Msg-id 1309363100.10707.134.camel@jdavis
Whole thread Raw
In response to Re: point types in "DISTINCT" queries  ("Jonathan S. Katz" <jonathan.katz@excoventures.com>)
Responses Re: point types in "DISTINCT" queries  ("Jonathan S. Katz" <jonathan.katz@excoventures.com>)
List pgsql-general
On Wed, 2011-06-29 at 11:37 -0400, Jonathan S. Katz wrote:
> Which means it *should* work, but first I would need to clean up the data and find the duplicates.  I was hoping this
mightwork: 
>
>     SELECT geocode, count(*)
>     FROM a
>     GROUP BY a.geocode
>     HAVING count(*) > 1;

Maybe you could use a self-join as a workaround for now, just to clean
up the data?

SELECT geocode, other_columns from a a1, a a2 where a1.other_columns <>
a2.other_columns and a1.geocode ~= a2.geocode;

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: "David Johnston"
Date:
Subject: Re: Real type with zero
Next
From: Grace Batumbya
Date:
Subject: Windows x64 : How do I get OSSP-UUID.sql contrib for postgresql x64