比如有两个表:
news 新闻 newsid title content之类
message 对新闻评论表: 包括messageid, content,pubtime,newsid references news(newsid)之类的信息
我要选择news选择10条留言次数最多的从多到少排列这样要怎么写,如果不在news表中添加留言次数字段的情况下
news 新闻 newsid title content之类
message 对新闻评论表: 包括messageid, content,pubtime,newsid references news(newsid)之类的信息
我要选择news选择10条留言次数最多的从多到少排列这样要怎么写,如果不在news表中添加留言次数字段的情况下
from news a left join message b on a.newsid = b.newsid
group by a.newsid,a.title,a.content
order by 留言数
是: 3 1 4 2 而正却的应该是 3 1 4 2。。还得请教这是怎么回事呢?