取出10条热点新闻

select top 10 n.id,n.title,n.createTime,c.[name],count(com.id) as comcount from news n inner join category c on n.caId=c.id inner join comment com on com.newsId=n.id group by n.id,n.title,n.createTime,c.[name] order by n.comcount desc

你可能感兴趣的:(C++,c,C#)