I’m updating multiple columns using case when. I want no action taken on cases not handled by when. I read this could be accomplished by using a begin end, but this doens’t work for me.
My syntax is:
update site_configuration set value =
case
when attribute_name="hostname" then "abcdef"
when attribute_name="backend" then "ab"
when attribute_name="col" then "col"
else
begin
end
end case
where uid="abcdef";
Does this syntax look right?
Thanks
Use just
In this case the value of the
valuecolumn will be left the sameInstead you can add one more condition to your
wherein this case you just omit
elseclause