I am trying to write the SQL for a forum, I have one table with the forum topics and another for the forum posts. I need to create the 'front page' listing that will show all of the topics and the date of the most recent post for each one. Currently I have 5 topics and 16 posts, I need a result set of the last post for each topic. Currently, I have only succeeded in returning all 16 rows sorted by date, but I can't use that. Eventually there will be well over 50 topics and a few hundred posts, so I have to make sure to only return one record (the most recent) for every topic.
I've been trying 'distinct' and outer and inner joins and MAX and everything else I can think of, but have yet to hit it.
I have this feeling that it is pretty simple and the answer is staring me in the face..... And of course this was due on Tuesday *groan*
Thanks for the help!!!
Michelle
(that should be 'novice programmer' *grin*)
I've been trying 'distinct' and outer and inner joins and MAX and everything else I can think of, but have yet to hit it.
I have this feeling that it is pretty simple and the answer is staring me in the face..... And of course this was due on Tuesday *groan*
Thanks for the help!!!
Michelle
(that should be 'novice programmer' *grin*)