Re: Newbie SQL Left Outer Join

From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 02/20/05

  • Next message: shall_at_uaex.edu: "Re: Newbie SQL Left Outer Join"
    Date: 20 Feb 2005 09:58:40 -0800
    
    

    Possibly this is what you want:

    SELECT R.name, M.item
     FROM MyReference R
     LEFT OUTER JOIN MyList M
     ON R.idkey=M.idkey
      AND M.fiscalyear=2005 And M.item=5
     WHERE R.fiscalyear=2005

    If you reference the unpreserved table (MyList) in the WHERE clause as
    you did then you effectively turn the OUTER join into an INNER join.

    -- 
    David Portas 
    SQL Server MVP 
    --
    

  • Next message: shall_at_uaex.edu: "Re: Newbie SQL Left Outer Join"