On Mon, 23 Feb 2009 15:44:05 +
Richard Huxton wrote:
> Tarlika Elisabeth Schmitz wrote:
> > On Fri, 20 Feb 2009 19:06:48 +
> > Richard Huxton wrote:
> >> try something like:
> >>
> >> SELECT t1.d, t1.s, t1.c, count(*)
> >> FROM t1
> >> LEFT JOIN (
> >>SELECT d,s,c FROM t2 WHERE x
> >
Tarlika Elisabeth Schmitz wrote:
> On Fri, 20 Feb 2009 19:06:48 +
> Richard Huxton wrote:
>> try something like:
>>
>> SELECT t1.d, t1.s, t1.c, count(*)
>> FROM t1
>> LEFT JOIN (
>> SELECT d,s,c FROM t2 WHERE x
>> ) AS t2_true USING (d,s,c)
>> GROUP BY t1.d, t1.s, t1.c;
>>
>> Warning - no
On Fri, 20 Feb 2009 13:23:47 -0600
Bob Henkel wrote:
> CREATE UNIQUE INDEX idx01_t1
> ON t1 USING btree (d, s, c);
>
> [...]
>
> SELECT t1.d, t1.s, t1.c, CASE WHEN t2.x IS NULL THEN 0 ELSE COUNT(*)
> END FROM t1
> LEFT OUTER JOIN t2
> ON t1.d = t2.d
>AND t1.s = t2.s
>AND
On Fri, 20 Feb 2009 19:06:48 +
Richard Huxton wrote:
> Tarlika Elisabeth Schmitz wrote:
> > 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.
> >
> >
On Fri, 20 Feb 2009 11:15:09 -0800 (PST)
Stephan Szabo wrote:
> On Fri, 20 Feb 2009, Tarlika Elisabeth Schmitz wrote:
>
> > 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,