Help with table join?
Posted: Mon Apr 25, 2005 11:34 am
Hi,
I'm trying to output forum topics in order of latest posted using my date column (timestamp) from my forum_posts table.
Here is what I'm got so far but it doesn’t seem to be working:
I'm trying to output forum topics in order of latest posted using my date column (timestamp) from my forum_posts table.
Here is what I'm got so far but it doesn’t seem to be working:
Code: Select all
SELECT DISTINCT
`forum_topics`.`forum_id`,
`forum_topics`.`topic`,
`forum_topics`.`date`,
`forum_topics`.`views`,
`forum_topics`.`id`
FROM
`forum_topics`
JOIN `forum_posts` ON (`forum_topics`.`id` = `forum_posts`.`topic_id`)
ORDER BY
`forum_posts`.`date` DESC