我已经尝试了这两种方法,我的表永远不会更新。它保持不变。我做错了什么?
UPDATE localhost_campaigns.list_name_counter SET counter = (CASE purl WHEN 'dingo' THEN '1' WHEN 'koala' THEN '0' END) WHERE purl IN (dingo, koala);
UPDATE localhost_campaigns.list_name_counter SET counter = CASE WHEN purl = 'dingo' THEN '1' WHEN purl = 'koala' THEN '0' END WHERE purl IN (dingo, koala);
答案 0 :(得分:1)
作为一个真正的解决方案;
为字符串使用引号。
像
UPDATE localhost_campaigns.list_name_counter
SET counter = (CASE purl WHEN 'dingo' THEN '1' WHEN 'koala' THEN '0' END)
WHERE purl IN ("dingo", "koala");