Re: Newbie SQL Left Outer Join
From: David Portas (REMOVE_BEFORE_REPLYING_dportas_at_acm.org)
Date: 02/20/05
- Previous message: shall_at_uaex.edu: "Newbie SQL Left Outer Join"
- In reply to: shall_at_uaex.edu: "Newbie SQL Left Outer Join"
- Next in thread: shall_at_uaex.edu: "Re: Newbie SQL Left Outer Join"
- Reply: shall_at_uaex.edu: "Re: Newbie SQL Left Outer Join"
- Messages sorted by: [ date ] [ thread ]
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 --
- Previous message: shall_at_uaex.edu: "Newbie SQL Left Outer Join"
- In reply to: shall_at_uaex.edu: "Newbie SQL Left Outer Join"
- Next in thread: shall_at_uaex.edu: "Re: Newbie SQL Left Outer Join"
- Reply: shall_at_uaex.edu: "Re: Newbie SQL Left Outer Join"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|