Re: Select distinct question ... complicated - Mailing list pgsql-hackers

From Bruno Wolff III
Subject Re: Select distinct question ... complicated
Date
Msg-id 20030806192548.GA29592@wolff.to
Whole thread Raw
In response to Select distinct question ... complicated  (The Pennant Shop <vicmogroup@yahoo.com>)
List pgsql-hackers
On Wed, Aug 06, 2003 at 12:05:47 -0700, The Pennant Shop <vicmogroup@yahoo.com> wrote:
> Hi ,
> 
> I have a table:
> item location
> aaa   10
> aaa   20
> bbb   10
> bbb   10
> ccc   10
> ccc   20
> 
> I need to select distinct items where locations are
> the same. So result set should look like:
> item loation
> bbb 10
> Already spent 7 hours on this one.

select item, location from table group by item, location having count(*) > 1;


pgsql-hackers by date:

Previous
From: The Pennant Shop
Date:
Subject: Select distinct question ... complicated
Next
From: "John Liu"
Date:
Subject: Re: Select distinct question ... complicated