看了sql,大概明白LZ什么意思了,要实现找出有最新回帖的前10个帖子的信息吧。其实这个分两个sql来查最合适,先通过forum_post找出最新回帖的10个帖子的id,
在根据帖子id查找forum_thread即可。select * from forum_post where first=1 order by lastpost desc limit 1,10;
因为每个帖子的一楼只有一个,因此可以这么查。注意要建一个联合索引(first,lastpost),
这样查询时会用到索引。
select * from forum_thread where tid in(xxx,yyy);希望能对你有帮助