对mysql快速批量修改,查重

更新
UPDATE mytable SET myfield = CASE id WHEN 1 THEN 'value' WHEN 2 THEN 'value' WHEN 3 THEN 'value' END WHERE id IN (1,2,3)

查重

select t.* from vinstatic t inner JOIN (select vin, count(0) num from vinstatic group by vin) t1 on t.VIN=t1.vin where t1.num>1

posted @ 2018-02-07 17:53  风好大  阅读(971)  评论(0编辑  收藏  举报