比如:
update wealth_table set coin = coin + 100 where id = 101;
update wealth_table set coin = coin + 200 where id = 102;如何把这两条语句合并成一条?
update wealth_table set coin = coin + 100 where id = 101;
update wealth_table set coin = coin + 200 where id = 102;如何把这两条语句合并成一条?
case id
when 101 then 100
when 102 then 200
else 0 end
虽然这个方法对于连续id很有效,但是我这个id不一定是连续的哈,
如果case多了(200+),效率会不会很低呢?