表1:
数量          编号
3               1  
23              1  
223             2  
233             2 
55              2
...
...
求如何从表1中查询并按编号计算,让后合成新表2
表2:
数量            编号
26              1
511             2

解决方案 »

  1.   

    select sum(数量 )as 数量 ,编号  from tb group by 编号 
      

  2.   


    select 数量=sum(数量),编号 from tb 
    group by 编号
    order by 编号
      

  3.   

    select sum(数量 )as 数量 ,编号  into tb2 from tb group by 编号   --将结果插入到TB2
      

  4.   

                    DataRow[] newrow = da.Select("sum(bb)as bb ,aa into da2 from da group by aa");后面缺少操作数
      

  5.   

    csdn 
    没人会解??????
      

  6.   


    select sum(数量 )as 数量 ,编号  from tb group by 编号 
    ???????????????????