I’m trying to create the following WHERE clause:
AND CASE @SomePRarmeter
WHEN 'this' THEN
user_id IN (SELECT * FROM dbo.func_Id1(@User))
WHEN 'that' THEN
user_id IN (SELECT user_id from dbo.func_Ids2(@OrgsForReporter)
END
But I’m getting an error: Incorrect syntax near the keyword ‘IN’ (in the first condition) , although separately both of those conditions work. What would be the correct way to make such a statement work?
Thanks!
Try