22,207
社区成员
发帖
与我相关
我的任务
分享
select
top 10 *
from
(select
count(1)
from
(
select
a.newsid,a.newstitle,count(b.msgid) as num
from
news a,msg b where a.newsid=b.newsid
group by
a.newsid,a.newstitle
)t
)t
order by
num desc
select top 10 news.newsid,newstitle,COUNT(msgid) as geshu
from news join msg on news.newsid=msg.newsid
group by news.newsid,newstitle
order by COUNT(msgid) desc
select
top 10 *
from
(select
count(1)
from
(
select
a.newsid,a.newstitle,count(b.msgid) as num
from
news a,msg b where a.newsid=b.newsid
group by
a.newsid,a.newstitle
)t
order by
num desc