my outerjoin is not working as expected.
below sql is working fine to display all the months for that particular period even if there is no revenue..
SELECT
sum(RPH.FACT.GRSREVENUE),
RPH.DIMDATES.MONTHYEAR
FROM
RPH.FACT_V RIGHT OUTER JOIN RPH.DIMDATES ON (RPH.FACT.SALESDATE = RPH.DIMDATES.DATEVALUE)
where
RPH.DIMDATES.DATEVALUE BETWEEN {ts '2011-01-01 00:00:00'} AND {ts '2012-12-13 11:56:55'}
GROUP BY
RPH.DIMDATES.MONTHYEAR
---------------Issue----------------
When I add a new join the outer join is not working.
SELECT
sum(RPH.FACT.GRSREVENUE),
RPH.DIMDATES.MONTHYEAR,
RPH.DIMSTATEACCOUNT.STATECODE
FROM
RPH.FACT_V
RIGHT OUTER JOIN RPH.DIMDATES ON (RPH.FACT.SALESDATE = RPH.DIMDATES.DATEVALUE)
inner JOIN RPH.DIMSTATEACCOUNT ON (RPH.DIMSTATEACCOUNT.STATESID = RPH.FACT.STATESID)
where
RPH.DIMDATES.DATEVALUE BETWEEN {ts '2011-01-01 00:00:00'} AND {ts '2012-12-13 11:56:55'}
GROUP BY
RPH.DIMDATES.MONTHYEAR,
RPH.DIMSTATEACCOUNT.statecode
_________________
↧
Outer join Issue
↧