关于分组合计的问题
现在有表A其中有4个字段   x1(CHAR)   x2(NUMBER)   x3(CHAR)   note(CHAR)   
 现在的数据为: 
 x1                                    x2                                          x3                                                      note 
 ----------------------------- 
 00001                        40                                             00003                                          备注12 
 00002                        50                                             00002                                          备注13 
 00003                        60                                             00004                                          备注14 
 00001                        70                                             00002                                          备注15 
 00002                        30                                             00032                                          备注16   
 现在要求输出内容为 
 x1   sum(x2)   note 
 其中note为x1里面x3数值最小的纪录。   
 比如上边数据应该输出 
 x1                              sum(x2)                              note 
 ------------------------ 
 00001                        110                                    备注15 
 00002                        80                                       备注13 
 00003                        60                                       备注14   
------解决方案--------------------select t2.x1,t2.sumX2 ,t1.note 
 from  
     ( 
     SELECT x1, note 
       FROM a 
      WHERE x2 IN (SELECT MIN (x2) 
                     FROM a) 
     ) t1 
     ( 
     SELECT   x1, SUM (x2) sumX2 
       FROM a 
     GROUP BY x1) t2       
 where t1.x1 = t2.x1
------解决方案----------------------测试数据 
 create table a (x1 CHAR(10),x2 NUMBER, x3 CHAR(10), note CHAR(10));   
 insert into a  
 select  '00001 ',40, '00003 ', '备注12 ' from dual union all 
 select  '00002 ',50, '00002 ', '备注13 ' from dual union all 
 select  '00003 ',60, '00004 ', '备注14 ' from dual union all 
 select  '00001 ',70, '00002 ', '备注15 ' from dual union all