MySQL_update同一张表
update tb1 inner join
(select type, count(*) as cnt
from tb1 group by type)
as der using(type)
set tb1.cnt = der.cnt
update tb1 inner join
(select type, count(*) as cnt
from tb1 group by type)
as der using(type)
set tb1.cnt = der.cnt