I have table something like this:-
SELECT UserName, IsManager FROM Employee
IsManager has only two values either 1 (which means user is a Manager) or 0 (which means user is not a Manager)
Now I want to write below query:-
DECLARE @IsManager INT
SET @IsManager = 2
WHERE IsManager =
WHEN @IsManager = 1 THEN 1
WHEN @IsManager = 0 THEN 0
WHEN @IsManager = 2 THEN 1 | 0 ----- THIS IS NOT WORKING, when I set @IsManager value to 2 then where clause should be like this "IsManager = 1 OR IsManager = 0"
Can anybody help me out in modifying about query so that it produces both the results when @IsManager variable value "2".
View Complete Post