Re: [HACKERS] Select distinct question ... complicated

2003-08-14 Thread John Liu
It's easier to create a simple pgsql function to do this ... johnl > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of The Pennant Shop > Sent: Wednesday, August 06, 2003 2:06 PM > To: [EMAIL PROTECTED] > Subject: [HACKERS] S

Re: [HACKERS] Select distinct question ... complicated

2003-08-14 Thread Bruno Wolff III
On Wed, Aug 06, 2003 at 12:05:47 -0700, The Pennant Shop <[EMAIL PROTECTED]> 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: >

Re: [HACKERS] Select distinct question ... complicated

2003-08-06 Thread Darcy Buskermolen
This should be on the otyher lists, novice or general for example but here is your answer anyway. SELECT item, location FROM foo GROUP BY item,location HAVING count(item) >1 AND count(location) > 1; On Wednesday 06 August 2003 12:05, The Pennant Shop wrote: > Hi , > > I have a table: > item

[HACKERS] Select distinct question ... complicated

2003-08-06 Thread The Pennant Shop
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. Thanks a lot / Alex __