Hello,
I am trying to update variable 'Type' (which is a pre-defined variable
without any value in it). Is there a way to combine Step1 to Step3 into
one single Update? I tried the query at the bottom but it didn't work.
Thanks a lot!
--STEP1:
Update TABLE1
set type = case
when name like '%Airline%' then 'Airlines'
else 'Others'
end
--STEP2:
update TABLE1
set type = case
when name like '%Brokerage%' then 'Brokerage'
else 'Others'
end
where type = 'Others'
--STEP3:
update TABLE1
set type = case
when name like '%card%' then 'Credit Card'
else 'Others'
end
where type = 'Others'
--Failed query:
Update TABLE1
set type = case
when name like '%Airline%' then 'Airlines'
else when name like '%Brokerage%' then 'Brokerage'
else when name like '%card%' then 'Credit Card'
else 'Others'
end