日期:2014-05-18 浏览次数:20635 次
select Sid,count(*)as Num from t_forums a group by Sid select b.*,c.SectionName from t_forums b,t_sections c where b.Id=(select max(id)as Id from t_forums where Sid=c.Id)
select a.*,
b.*,
c.SectionName
from t_forums b,t_sections c,
(select Sid,
count(*)as Num
from t_forums a
group by Sid)a
where b.Id=(select max(id)as Id from t_forums where Sid=c.Id)
and a.sid=b.sid