update user a set a.posts=(select b.counts from (select authorid,count(*) counts from post group by authorid) b where a.uid=b.authorid)