i have the following query.
SELECT DD.DATE_KEY , (SELECT MIN(NVI_DATE) AS NVI_MIN_DATE FROM FCT_SPA_NVI_OUTRIGHT A WHERE A.VENDOR_CODE=V.VENDOR_CODE) AS NVI_MIN_DATE , VO.BANK_ACCOUNT_NO , VO.BANK_NAME , VO.BANK_ROUTING_NO FROM DIM_VENDOR V LEFT JOIN FCT_SPA_NVI_OUTRIGHT VO ON V.VENDOR_CODE = VO.VENDOR_CODE LEFT JOIN FCT_SPA_NVI_MERCHANDISE VP ON VO.NVI_KEY=VP.NVI_KEY LEFT JOIN DIM_DATE DD ON VO.NVI_DATE=DD.DATE_FLD
in the above query, how to use NVI_MIN_DATE in the ON condItion like.,
LEFT JOIN DIM_DATE DD ON NVI_MIN_DATE=DD.DATE_FLD
Thanks in advance.
bala krishna