我有这些表:
评论
uid
id
pid
页面
pid
user
用户
id
rank
.
.
.
这个查询:
SELECT
u.*,
count(p.id) as 'pages',
count(c.id) as 'comments'
FROM
`users` u
LEFT OUTER JOIN `pages` p ON p.user = u.id
LEFT OUTER JOIN `comments` c ON c.uid = u.id
GROUP BY u.id
出于某种原因,当用户只有 1 条评论时,它会显示 2 条评论。
查询有问题吗?