earlysunrirse - Friday, March 24, 2017 11:12 AM
This uses two different instances of dbo.User_Table: one aliased "y" and the other unaliased. This may not (and probably WILL not) produce the results that you are expecting.
Also, the CASE expression is unnecessary in this statement, because the join conditions are exactly the same as the CASE conditions, so only the first condition will ever be met. The CASE expression would still be unnecessary even if you changed the JOIN to a LEFT OUTER JOIN.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA