Skip navigation

Need a SQL-like IN (list) for use in functions

score 52
You have not voted. Active

We have non-ISO regions. Right now, I have to create an IF statement with 1 line per country, ie:

 

[country_code] = 'AA' THEN 'region1' ELSEIF

[country_code] = 'BB' THEN 'region1' ELSEIF

[country_code] = 'CC' THEN 'region1' ELSEIF

[country_code] = 'XX' THEN 'region1' ELSEIF

[country_code] = 'YY' THEN 'region1' ELSEIF

[country_code] = 'ZZ' THEN 'region1' ELSEIF

 

I'd like to be able to do a sql-like 1 line per region, ie:

 

IF [country_code] IN ( 'AA','BB','CC','XX','YY','ZZ') THEN 'region1'

 

which would be a lot less painful.

Comments

Vote history