數據庫更新篇

將一個表裏的聚合數據同步到另外一個表中ui

update ultrax_common_member_count member LEFT join ( SELECT thread.authorid as uid,count(1) as num FROM ultrax_forum_thread thread where thread.displayorder>=0 and thread.authorid=1 group by thread.authorid ) A ON member.uid=A.uid set member.threads=A.num where A.uid=1同步

相關文章
相關標籤/搜索