日期:2014-05-20 浏览次数:20723 次
select
top 10
s.ID,s.CreateTime,
count(sc.ID) SCount,
count(p.ID) PCount,
count(r.ID) RCount
from
s
left join sc on s.id=sc.SubjectID
left join p on s.id=p.SubjectID
left join r on s.id=r.SubjectID
group by
s.ID,s.CreateTime
order by s.CreateTime desc