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)
UPDATE project_info pi,
(SELECT
phone, COUNT(*) count
FROM
project_info
GROUP BY phone) re
SET
pi.count
= re.count
WHERE
pi.phone = re.phone
网友评论