56,739
社区成员
![](https://csdnimg.cn/release/cmsfe/public/img/topic.427195d5.png)
![](https://csdnimg.cn/release/cmsfe/public/img/me.40a70ab0.png)
![](https://csdnimg.cn/release/cmsfe/public/img/task.87b52881.png)
![](https://csdnimg.cn/release/cmsfe/public/img/share-circle.3e0b7822.png)
select *
from (
(SELECT t.*, f.name,flag=0 FROM threads t, forums f where f.fid=t.fid and id=10000)
union all
(SELECT t.*, f.name ,flag=1 FROM threads t, forums f where f.fid=t.fid and id<>10000 ORDER BY t.dateline DESC LIMIT 9)
) t
order by flag,dateline desc
select * from (
(SELECT t.*, f.name FROM threads t, forums f where f.fid=t.fid id=10000)
union all
(SELECT t.*, f.name FROM threads t, forums f ORDER BY t.dateline DESC LIMIT 0, 10)
) t
order by id=10000 desc,datelineDESC LIMIT 0, 10