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
私の問題は、元の投稿に対して複数の返信があった場合、当然、そのディスカッション ID に対して複数の結果が得られることです。同じディスカッション ID を含む後続の行を削除する方法を教えてください。どのレコードが選択されても問題ありません。新しい返信が関連付けられているトピックの ID を取得するだけです。ありがとう。