Mysql
 sql >> Base de Dados >  >> RDS >> Mysql

operando deve conter 1 coluna


Você não deve incluir COUNT(p.post_id) AS total_posts em SELECT list em sua subconsulta.
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
);