select @OfficeCode=OfficeCode from Office where OfficeID= @OfficeID
SELECT OfficeId FROM Office
WHERE (CASE WHEN @OfficeLevel=1 THEN FirstLevel
WHEN @OfficeLevel=2 THEN SecondLevel
WHEN @OfficeLevel=3 THEN ThirdLevel
WHEN @OfficeLevel=4 THEN FourthLevel
END) = @OfficeCode
No comments:
Post a Comment