答案 0 :(得分:1)
SELECT posted_by, count(*) AS total
FROM(SELECT posted_by FROM article
UNION ALL
SELECT posted_by FROM ebook
UNION ALL
SELECT posted_by FROM forum_thread) AS counted
GROUP BY posted_by
ORDER BY total DESC
LIMIT 1
答案 1 :(得分:0)
由于所有表都有列,因此您可以使用UNION ALL
。另外,我建议在posted_by字段而不是名称上使用UserID
。如果要输出名称,只需使用用户表连接表。