Can I use different selection comparisons based on a passed value in SQL?

Solution for Can I use different selection comparisons based on a passed value in SQL?
is Given Below:

I wasn’t really sure of the best wording for the question but here is my dilemma:

I am passing a value to a sql query as @district. This value may be the exact district but it also has the possibility of being a value that should create a set of multiple districts. So if I pass 002 I want the WHERE clause to say I.Offense_Tract = @district. If I pass Other I want the WHERE clause to say I.Offense_Tract in (). What I am trying to do is something like:

AND
CASE
   WHEN @district = "Other" THEN I.Offense_Tract in ('BAR','COL','GER','MEM','MIL','JAIL','JAILEAST','SCCC','1USD','2USD')
ELSE I.Offense_Tract = @district
END

But this doesn’t work. The problem, restated, is if the value passed is anything other than Other, I just want it to be =. If Other is passed, I want it to be IN.

You don’t need the CASE expression.
You can apply this logic with operators AND and OR:

AND (
      (@district="Other" AND I.Offense_Tract IN ('BAR','COL','GER','MEM','MIL','JAIL','JAILEAST','SCCC','1USD','2USD'))
      OR
      (@district <> 'Other' AND I.Offense_Tract = @district)
    )

Note that, in databases like MySql, Postgresql and SQLite, your code would work as it is.