select article
from tb tb1
where class in (select class from tb group by class)
order by datetime desc Limit 0,10
from tb tb1
where class in (select class from tb group by class)
order by datetime desc Limit 0,10
我要的结果是:-类别1
--文章1
--文章2
--文章3
...
--文章10
类别2
--文章1
--文章2
--文章3
...
--文章10
...
-类别N
--文章1
--文章2
--文章3
...
--文章10
$a=['类别1','类别2'...];
for(i=0;i<10;i++){
$exec="select * from ".$a[i]." order by time limit 0,10";
....
}