Aleks
asked on
Help with query (WHERE clause)
I have a select statement, but I think the WHERE clause is incorrect. This is my current code:
In reality what I need is to get the g.CurEmp=1 inside the left join dbo.Employment
In other words, the left join should be to that table HERE CurEmp=1
and the final WHERE clause should only read c.Id = @caseid
How can I do this?
Select *
FROM Cases AS c
LEFT JOIN Users e ON e.UserId = c.AlienId
LEFT JOIN dbo.Employment AS g ON g.UserId = c.AlienId
WHERE c.Id = @caseid AND g.CurEmp = 1;
In reality what I need is to get the g.CurEmp=1 inside the left join dbo.Employment
In other words, the left join should be to that table HERE CurEmp=1
and the final WHERE clause should only read c.Id = @caseid
How can I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER