My query throws an error
Incorrect syntax near '='.
Please tell me where I am doing wrong.
case
when proj.country_name = 'UK'
then proj.region = 'NE'
when proj.Country_Name = 'Belgium' or proj.Country_Name = 'Germany' or proj.Country_Name = 'Netherlands'
then proj.region = 'CE'
when proj.Country_Name = 'Spain' or proj.Country_Name = 'France' or proj.Country_Name = 'Italy'
then proj.region = 'SE'
else proj.region
end as Region_NCC,
Thanks
That is invalid syntax case
expression doesn't return value with column name :
case when proj.country_name = 'UK' then 'NE'
when proj.Country_Name in ('Belgium', 'Germany', 'Netherlands') then 'CE'
when proj.Country_Name in ('Spain','France', 'Italy') then 'SE'
else proj.region
end as Region_NCC
I have used IN
clause instead of strange OR
clause.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments