在外联查询中如何如何把指定列值相同的所有记录都查询出来

图片说明

问题描述不太清楚哦,你是想把content中记录相同的个数大于1的查出来吗?

select * form a where id in (select id from a group by id having count(id) >1) 你自己看着改改

说详细下,最好给出个示例

SELECT * FROM reply r INNER JOIN (
seleect COUNT(1) ct, r.content FROM reply r LEFT JOIN COMMENT c ON r.id = c.replyId LEFT JOIN t_user u ON u.id = c.reviewer WHERE r.newsId = 1 GROUP BY r.content
) a ON r.content = a.content
WHERE a.ct > ?
问号可以修改为数字

图片说明

10:38:45
袁弟臻 2018/3/29 10:38:45
参照 https://blog.csdn.net/rainyspring4540/article/details/50231435 自己对照内容更改