[b]帖子列表[/b]
[img]http://dl.iteye.com/upload/attachment/427337/72ccef0b-1527-39c2-8c85-08a9ee1ebcda.png[/img]
[b]帖子回复列表[/b]
[img]http://dl.iteye.com/upload/attachment/427339/575acc57-a065-3c81-b659-31fa8ff7fa80.png[/img]
[b]显示所有帖子及帖子的最新回复[/b]
[img]http://dl.iteye.com/upload/attachment/427353/405cf793-ff28-37e4-a8e7-4c1e26224691.png[/img]
[img]http://dl.iteye.com/upload/attachment/427337/72ccef0b-1527-39c2-8c85-08a9ee1ebcda.png[/img]
[b]帖子回复列表[/b]
[img]http://dl.iteye.com/upload/attachment/427339/575acc57-a065-3c81-b659-31fa8ff7fa80.png[/img]
[b]显示所有帖子及帖子的最新回复[/b]
select t.id, t.title, tb.id, tb.content
from forum_topic t
left join (select * from forum_topic_back where id in (select max(id) from forum_topic_back where status=1 group by topic_id)) tb on tb.topic_id=t.id
where t.status=1
order by t.id desc
[img]http://dl.iteye.com/upload/attachment/427353/405cf793-ff28-37e4-a8e7-4c1e26224691.png[/img]