id   count
1     50
1     50
1     20
2     30
2     10
3     10
3     50
查询出来结果就是
id  count
1    120
2    40
3    70

解决方案 »

  1.   

    select id,count([count])
    from tablename
    group by id
      

  2.   

    select id,sum([count])
    from tablename
    group by id
      

  3.   

    select id,sum(count) from a group by id很简单的一个 分组查询
      

  4.   

    tryselect id, sum(count) as count from table group by id
      

  5.   

    select id,sum([count])
    from tablename
    group by id
      

  6.   

    select id,sum([count]) from Table1 group by id
      

  7.   

    select id,sum([count])
    from tablename
    group by id