本帖最后由 chenxuezhi1986 于 2011-02-22 01:05:39 编辑

解决方案 »

  1.   

    $sql = "select *,sum(myscore) as allscore from talbe group by id order by allscore desc";
      

  2.   


    select username,SUM(myscore) as score from tabletest group by username order by score desc
      

  3.   

    笔误 更正:
    $sql = "select *,sum(myscore) as allscore from talbe group by username order by allscore desc";
      

  4.   


    SELECT username,sum(myscore) as score FROM `test` GROUP BY username ORDER BY score DESC
      

  5.   

    select 用户名,sum(积分)
    from xxxx
    group by 用户名
    order by 2 desc;