Hi guys,
I need help porting the following query from Oracle to Postgresql.
In particular the (+) operator. I am not sure how to perform the
equivalent LEFT OUTER JOIN in PostgreSQL. I have checked out the
porting guides, but they suggest using a UNION, and other postings
have examples using LEFT JOINS. Which method is more widely
accepted?
Thanks in advance,
Nick.
CREATE OR REPLACE VIEW n_sessions_day_user AS
SELECT b.date_id, b.n_sessions_day,
nvl(a.n_users, 0) AS members, b.n_users AS non_members
FROM visits_grouped a, visits_grouped b
WHERE b.n_sessions_day = a.n_sessions_day(+)
AND b.date_id = a.date_id(+)
AND 1 = a.member_p(+)
AND b.member_p = 0;