AW: [HACKERS] Release 6.4 - Mailing list pgsql-hackers

From Andreas Zeugswetter
Subject AW: [HACKERS] Release 6.4
Date
Msg-id 01BDD83B.98976290@zeugswettera.user.lan.at
Whole thread Raw
List pgsql-hackers
>In your example:
>
>    SELECT x.a, x.b, count(y.a) FROM t1 x, t2 y
>    WHERE x.a = y.a GROUP BY x.a, x.b;
>
>Are you suggesting that if there are rows in t1 that are not in t2, that the
>count could/should be zero?

Nooooooo, the count can only be 0 if you do an outer join in this example, like:
SELECT x.a, x.b, count(y.a) FROM t1 x, outer t2 y
      WHERE x.a = y.a GROUP BY x.a, x.b;
Otherwise rows with count of zero are eliminated. This is correct behavior.

Andreas


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Re: hackers-digest V1 #954
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] questionable code in heap_formtuple()]