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  阅读(498)  评论(0编辑  收藏  举报