从1张海报中复制主题标题搜索

时间:2013-08-20 11:34:20

标签: php mysql sql

我有一个旧论坛。在这个论坛上有很多双主题(同名)。我找到了所有具有此选择的双主题标题:

SELECT topic_title, topic_time, forum_id, topic_first_post_id, topic_first_poster_name, topic_id, topic_poster, COUNT( * ) TotalCount
FROM phpbb3_topics
GROUP BY topic_title
HAVING COUNT( * ) >1

现在我想要来自同一个人topic_poster

的所有双主题标题 你能告诉我一个解决方案吗?请编辑我的existend选择,以显示具有相同topic_poster ID的所有双主题标题(topic_poster是ID字段)

非常感谢

2 个答案:

答案 0 :(得分:0)

您可以通过以下方式将topic_poster添加到您的论坛:

SELECT topic_title, topic_time, forum_id, topic_first_post_id, topic_first_poster_name, topic_id, topic_poster, COUNT( * ) TotalCount 
FROM phpbb3_topics
GROUP BY topic_title, topic_poster
HAVING COUNT( * ) >1

答案 1 :(得分:0)

试试这个:

SELECT topic_poster_id, topic_title, topic_time, forum_id, topic_first_post_id, topic_first_poster_name, topic_id, topic_poster, COUNT( * ) TotalCount
FROM phpbb3_topics
GROUP BY topic_poster_id, topic_title
HAVING COUNT( * ) >1