FULL OUTER JOIN
189396Jan 25 2006 — edited Jan 25 2006Hi
Is it necessary for two tables to have foreign key relationship, if we are joning them using a FULL OUTER JOIN ?
Because I have a query in which two queries are used as tables and are joined using FULL OUTER JOIN. And it doesn't give me all the rows from both the queries.
My sql is:
Select mv_base.book_asof_date, mv_up.book_asof_date, mv_up.market_value-mv_base.market_value
From
(Select v1.dw_run_id, v1.book_asof_date book_asof_date, Sum(Nvl(f.market_value,0)) market_value
from RM_DW_TIME_SERIES_REPORTS_VW v1, rm_dw_book_f f
where v1.dw_run_id=f.dw_run_id
and v1.run_name='daily.std.0.base.0'
and v1.application_name='PVMReporting'
Group By v1.dw_run_id, v1.book_asof_date
) mv_base full outer join
(Select v.dw_run_id, v.book_asof_date book_asof_date, Sum(nvl(f.market_value,0)) market_value
from RM_DW_TIME_SERIES_REPORTS_VW v, rm_dw_book_f f
where v.dw_run_id=f.dw_run_id
and v.run_name='daily.std.0.up50.0'
and v.application_name='PVMReporting'
Group By v.dw_run_id, v.book_asof_date
) mv_up
ON mv_base.book_asof_date=mv_up.book_asof_date;
Any answers will be appreciated.
Shalu