operand should contain 1 columns [duplicate]

ⅰ亾dé卋堺 提交于 2019-12-01 23:19:59

You shouldn't include COUNT(p.post_id) AS total_posts in SELECT list in your subquery. Just

SELECT topic_id   
FROM phpbb_topics AS t
WHERE t.topic_id IN (
    SELECT p.topic_id --, COUNT(p.post_id) AS total_posts 
    FROM phpbb_posts AS p
    WHERE p.poster_id = 61640
    GROUP BY p.topic_id
    HAVING t.topic_replies_real = COUNT(p.post_id) - 1
);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!