日安家伙, 我不知道未知列“article.mycount” ......为什么不这样的查询工作:MySQL的 - 在“where子句”
SELECT article.topic, article.ID,
(
SELECT COUNT(*) FROM comment
WHERE article.ID_art = comment.foreign_ID_art
GROUP BY foreign_ID_art
)
AS mycount
FROM article
WHERE article.mycount = '0'
看起来不错,但它不起作用。它写给我: '有条款'中的未知列'article.mycount' – RePRO
我的不好,现在应该工作。它应该只是简单的'HAVING mycount ='0'' –
现在的作品,谢谢! – RePRO