mysql如何按文章评论数排列?高手帮忙写一条mysql语句

解决方案 »

  1.   

    select f.msg,a.title from f left join a on f.cid=a.cid order by f.msg desc
    sql不太好,也没测试,应该是这样
      

  2.   

    设f表有字段fid对应每篇文章
    select f.msg, a.title from a, f where a.id=f.fid order by f.msg desc
      

  3.   

    msg是一条一条的,是内容性质,如“好文章啊”,不是数字
      

  4.   

    select ft.msg, at.title from f ft, a at where ft.相同唯一字段 = at.相同唯一字段 order by ft.msg desc
      

  5.   

    select count(*) ft.num, ft.msg, at.title from f ft, a at where ft.相同唯一字段 = at.相同唯一字段 order by ft.num desc