nrep
Well-known member
It looks like I've got problems with duplicate content on one of my very old forums. There are some threads posted in different forums with the same title, username and first post text (but have differing replies).
I'd like to try and run a MySQL query that finds duplicate threads by matching titles, matching thread username and matching first post message text.
It's the matching first post message text that trips me up. I know that I need to get the "xf_post.message" content and see if there are duplicates where xf_thread.title and xf_thread.username have matches.
Can anyone help me nail this query please?
Here is what I have, without matching the xf_post.message content:
I'd like to try and run a MySQL query that finds duplicate threads by matching titles, matching thread username and matching first post message text.
It's the matching first post message text that trips me up. I know that I need to get the "xf_post.message" content and see if there are duplicates where xf_thread.title and xf_thread.username have matches.
Can anyone help me nail this query please?
Here is what I have, without matching the xf_post.message content:
Code:
SELECT DISTINCT *
FROM xf_thread t1
WHERE EXISTS (SELECT * FROM xf_thread t2
WHERE t2.thread_id <> t1.thread_id
AND t2.title = t1.title
AND t2.username = t1.username
);