mysql 批量更新(可用存储过程)

2024-11-25 04:33:49
推荐回答(2个)
回答1:

update tableName set click=click+
case
when id=1 and ip='198.25.54.45' and date=11254987 then 2
when id=1 and ip='185.45.14.47' and date=11547899 then 4
when id=2 and ip='184.78.45.14' and date=13457489 then 3
end;

回答2:

不知道你这个click=click+2,+3,+4 是怎么个规律??是所有数据都加的一样的?