How to compare a SQL variable against multiple values:
Here is the scenario;
Now I want to compare @JobTitle value against multiple strings without using OR in the IF statement?
instead of using multiple OR, is there any other way to accomplish this?
Here is the scenario;
Code:
Declare @JobTitle varchar(10) Select @JobTitle = JobTitle from tableName where xxx=xxx
Code:
if @JobTitle = 'AAAAA' OR @JobTitle = 'BBBBBB' OR @JobTitle = 'CCCCC' ......
Comment