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

posted @ 2015-07-12 20:59  MrMrCash  阅读(504)  评论(0)    收藏  举报