I have two tables, 'discussion' and 'discussion_responses'. A unique ID from 'discussion' is used in 'discussion_responses' to identify the response to the original post in a forum. I created the following query to extract the posts that have NEW replies, but are NOT linked to new topics. Both tables have a field for the date added and 'colname' is Dreamweaver's variable name for the visitor's last log-in date retrieved from another table:
SELECT *
FROM discussion, discussion_responses
WHERE discussion.discussion_date < colname
AND discussion_responses.discussion_date > colname
AND discussion.discussion_ID = discussion_responses.discussion_ID
ORDER BY discussion.discussion_title ASC
My problem is that where more than one reply has been made to the original post, I naturally get more than one result for that discussion ID. Can anyone please advise me as to how I can eliminate subsequent rows containing the same discussion_ID? It doesn't matter which record is chosen, only that I get the ID of any topic that has had a new reply associated with it. Thanks.