我需要获得来自 Drupal + phpBB 的大多数评论 + 帖子的用户列表。
我正在使用 mySQL。
Drupal 数据库结构:dr_comments(cid,uid) dr_users(uid,name)
phpBB: phpbb_posts(post_id,poster_id) phpbb_users(user_id,username)
我有大多数来自 Drupal 和 phpBB 的评论的用户的 SQL 代码不在一起。
德鲁巴:
SELECT
U.name,
COUNT(C.cid) AS CommentCount
FROM
dr_users AS U
INNER JOIN dr_comments AS C ON U.uid = C.uid
GROUP BY
U.name
ORDER BY
COUNT(C.cid) DESC
LIMIT 10
phpBB:
SELECT
U.username,
COUNT(C.post_id) AS CommentCount
FROM
phpbb_users AS U
INNER JOIN phpbb_posts AS C ON U.user_id = C.poster_id
GROUP BY
U.username
ORDER BY
COUNT(C.post_id) DESC
LIMIT 10
我不知道如何将它合并在一起。