JOIN and aggregate problem - Mailing list pgsql-sql

From Tarlika Elisabeth Schmitz
Subject JOIN and aggregate problem
Date
Msg-id 20090220180442.45a65170@dick.coachhouse
Whole thread Raw
Responses Re: JOIN and aggregate problem  (Bob Henkel <bob.henkel@gmail.com>)
Re: JOIN and aggregate problem  (Richard Huxton <dev@archonet.com>)
Re: JOIN and aggregate problem  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Re: JOIN and aggregate problem  (Bob Henkel <bob.henkel@gmail.com>)
List pgsql-sql
I have 2 tables T1 and T2

T1 has the columns: D, S, C. The combination of D,S,C is unique.
T2 has the columns: D, S, C, and boolean X. The combination of D,S,C is
not unique. 

I need to produce the following result for every occurrence of T1:
D,S,C, COUNT

COUNT is the number of matching D,S,C combinations in T2 where X = true.
There might be no matching pair in T2 or there might be match but X
is false.

How can I express this?



--


Best Regards,

Tarlika Elisabeth Schmitz


pgsql-sql by date:

Previous
From: "M.P.Dankoor"
Date:
Subject: Re: How concat 3 strings if 2 are not empty?
Next
From: Bob Henkel
Date:
Subject: Re: JOIN and aggregate problem