MySQL update case help

前端 未结 6 1483
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 18:58

Can anybody tell me how to fix this query?

update ae44
set Price = Case
when ID = \'AT259793380\' then \'500\'
when ID = \'AT271729590\' then \'600\'
when ID         


        
6条回答
  •  有刺的猬
    2020-11-27 19:48

    You can try a simple query like:

    UPDATE `table`
    SET Price = ELT(field(ID,'AT259793380','AT271729590','AT275981020'), '500', '600', '700')
    WHERE ID IN ('AT259793380','AT271729590','AT275981020')
    

提交回复
热议问题