From: Brian Cox <bcox4982@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: joining VIEWs
Date: Tue, 22 Aug 2006 09:40:04 -0700 (PDT)
Message-ID: <20060822164004.88034.qmail@web39806.mail.mud.yahoo.com> (raw)
Given a view like:
create view view1 as
select g.id as UserGroupId, s.uid as UserId, s.time as StartTime from stats s join groups g on g.uid = s.uid
and a SELECT like:
select a.UserGroupId,b.UserGroupId from view1 a
full outer join view1 b on b.UserGroupId = a.UserGroupId
WHERE a.StartTime >= '2006-1-1' AND a.StartTime < '2007-1-1'
AND b.StartTime >= '2005-1-1' AND b.StartTime < '2006-1-1';
where there are 5695 rows in 2006 and 1 row in 2005, I expected to get a result set of 5695 rows, but instead got only 1 row (the common row in the 2 years). This seems contrary to the definition of "full outer join". Am I missing something?
Thanks,
Brian Cox
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1ยข/min.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bcox4982@yahoo.com
Subject: Re: joining VIEWs
In-Reply-To: <20060822164004.88034.qmail@web39806.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox