Hi I was wondering what the syntax would be to have a left join from one table to a resulting query without the view. Currently I use a view and it works fine but I was wondering how to achieve this without creating the view.
Here is the current view's SQL statement ( without the create view etc)
VIEW NAME: vw_2009
SELECT
fundinfo.fk_budget_ID,
fundinfo.fk_tiertwo_ID,
Sum(fundlink.fundlink_amt)
FROM (fundinfo LEFT JOIN fundlink on((fundinfo.pk_fund_ID = fundlink.fk_fund_ID`)))
WHERE ((fundlink.date_create <= '2009-03-15') and (fundlink.date_create >= '2009-01-01') and (fundinfo.fundinfo_budg_yr = '2009'))
GROUP by fundinfo.fk_tiertwo_ID
Here is the query that is using that view on the right side.
SELECT
budget.budget_name,
vw_2009.Sum(fundlink.fundlink_amt)
FROM
budget
Left Join vw_2009 ON budget.pk_budget_ID = vw_2009.fk_budget_ID
So how do I combine them into one statement? I tried creating a subquery but I couldnt get it working correctly.
TIA.