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
-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
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
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
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);
-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
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
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