Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-05 Thread Sam Mason
On Mon, Aug 04, 2008 at 05:00:31PM -0400, Rajarshi Guha wrote: On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: select a.cid as ac, b.cid as bc, count(*) from aic_cid a left outer join aic_cid b on a.cid b.cid and a.id = b.id where b.cid is not null group by a.cid, b.cid order by

[GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Rajarshi Guha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I have a table of the form aid cid - - 1 123 2 456 3 667 3 879 3 123 4 878 4 456 4 123 5 999 5 667 5 879 My goal is to identify for each pair of cid values, the number of

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread David Wilson
On Mon, Aug 4, 2008 at 2:08 PM, Rajarshi Guha [EMAIL PROTECTED] wrote: select count(aid) where cid = 123 and cid = 456; but I was wondering whether I could construct a single SQL statement to do this. Any pointers would be appreciated, Typed into gmail, so may need some tweaking, but

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Scott Marlowe
On Mon, Aug 4, 2008 at 1:02 PM, David Wilson [EMAIL PROTECTED] wrote: On Mon, Aug 4, 2008 at 2:08 PM, Rajarshi Guha [EMAIL PROTECTED] wrote: select count(aid) where cid = 123 and cid = 456; but I was wondering whether I could construct a single SQL statement to do this. Any pointers would

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Francisco Reyes
On 2:08 pm 08/04/08 Rajarshi Guha [EMAIL PROTECTED] wrote: paircount - - 123 456 1 667 879 2 create temp table aic_cid ( id smallint, cid smallint ); insert into aic_cid values (1,123); insert into aic_cid values (2,456); insert into aic_cid values (3,667);

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Rajarshi Guha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: On 2:08 pm 08/04/08 Rajarshi Guha [EMAIL PROTECTED] wrote: paircount - - 123 456 1 667 879 2 snip select a.cid as ac, b.cid as bc, count(*) from aic_cid a left

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Ragnar
On mán, 2008-08-04 at 17:00 -0400, Rajarshi Guha wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: On 2:08 pm 08/04/08 Rajarshi Guha [EMAIL PROTECTED] wrote: paircount - - 123 456 1 667 879 2

Re: [GENERAL] is a 'pairwise' possible / feasible in SQL?

2008-08-04 Thread Rainer Pruy
Rajarshi Guha wrote On Aug 4, 2008, at 4:55 PM, Francisco Reyes wrote: On 2:08 pm 08/04/08 Rajarshi Guha [EMAIL PROTECTED] wrote: paircount - - 123 456 1 667 879 2 snip select a.cid as ac, b.cid as bc, count(*) from aic_cid a left outer join aic_cid