如:  
    NAME     COUNT
    ......
    01       100
    02       120
    01       60
    ......合并后的数据库为:
    ......
    01       160
    ......

解决方案 »

  1.   

    如果COUNT是int类型的,可以用
    select sum(COUNT) FROM 表名 WHERE NAME = '01';
    来合并!
      

  2.   

    select [name],case [name]
    when '1' then sum([count])
    when '2' then sum([count])
    end as count into ttt
    from t group by [name]
      

  3.   

    晕~~ 更新表不就简单了?如果 int nCount 是得到和,那么:
    delect from table where name='01'
    insert table (name,count) values (01,nCount)不就行了?
      

  4.   

    但是我事先不知道哪个编号的记录有重复的,有没有什么SQL语句能自动合并重复的,并更新数据库?