unique fields - Mailing list pgsql-sql

From Adrian Johnson
Subject unique fields
Date
Msg-id AANLkTimBbF+6FrjuYSC9BcekpsT=mboGUo6B2kGFky-G@mail.gmail.com
Whole thread Raw
Responses Re: unique fields  (Sergey Konoplev <gray.ru@gmail.com>)
List pgsql-sql
hi:

I have a fairly large table.

sample_id | chr | cfrom | cto |
-------------------------------------------
1                c2    19       20
2                c2    19       20
3                c2    19       20
1                c5    10       11
3                c5    10       11


(25,000 rows)

I want to find out how many duplications are there for chr, cfrom and cto

a.   c2,19,20 are common to samples 1,2 and 3.

since there will be many instances like that, do I have to loop over
entire rows and find common chr, cfrom and c2 and ouput with
sample_id.
how can I do that.

thanks
adrian


pgsql-sql by date:

Previous
From: Craig Ringer
Date:
Subject: Re: HowTo divide streetname from house-nr ?
Next
From: negora
Date:
Subject: Re: HowTo divide streetname from house-nr ?