Greetings!
I am new here, but this looks to be a fine place to get an answer to my noob-like question.
My query involves two tables. FORUM_TOPIC and FORUM_REPLY.
What I'm trying to do is get only the latest FORUM_REPLY.FORUM_REPLY_DATE, for each FORUM_TOPIC. The two tables are linked via FORUM_TOPIC.FORUM_TOPIC_ID.
Ideally, I'd like the date to return null if there is no reply at all. And the latest date if there is more than one reply. Bottom line, there can only be one record returned for each unique topic id.
Thanks for your time!
Here is my retarded query as it stands now:
I am new here, but this looks to be a fine place to get an answer to my noob-like question.
My query involves two tables. FORUM_TOPIC and FORUM_REPLY.
What I'm trying to do is get only the latest FORUM_REPLY.FORUM_REPLY_DATE, for each FORUM_TOPIC. The two tables are linked via FORUM_TOPIC.FORUM_TOPIC_ID.
Ideally, I'd like the date to return null if there is no reply at all. And the latest date if there is more than one reply. Bottom line, there can only be one record returned for each unique topic id.
Thanks for your time!
Here is my retarded query as it stands now:
Code:
select Forum_topic.Account_id, Forum_Reply.Account_ID, forum_reply.Forum_Reply_Date, Forum_topic.Forum_Topic_ID, Forum_Topic_Name
from Forum_Topic
left outer join forum_reply
on forum_reply.forum_topic_id=forum_topic.Forum_Topic_ID
where forum_topic.forum_category_id=927