不知道是不是这个意思select phonenum,sum(charge) as total from (
  select phonenum,charge from a01
  union
  select phonenum,charge from a02
  union
  select phonenum,charge from a03
 ) a where rownum<=10 group by phonenum order by total desc;

解决方案 »

  1.   

    try it ..
    select tt.phonenum
      from ( 
            select AA.phonenum,
                   sum(AA.charge) as all_charges
              from (       
                    select phonenum,charge from A01
                    union all
                    select phonenum,charge from A02
                    union all
                    select phonenum,charge from A03
                   )AA
             group by AA.phonenum
             order by 2 desc
           )tt
     where rownum <= 10;
      

  2.   

    谢谢楼上的,以及楼上的楼上的
    我刚好摸索出来
    发帖前是处于
    2楼的状态
    group  order  where 的顺序没搞清
    查处的数据是错的where   rownum <=10   group   by   phonenum   order   by   total   desc