分开写不行吗?
写两条sql语句

解决方案 »

  1.   

    select bh,mc,sl,dj,je from abc group by bh,mc,sl,dj
    union all 
    select '合计' as bh,null as mc,null as sl,null as dj,sum(je) as je from abc
      

  2.   

    select * from abc
    union all
    select null,null,null,null,sum(je) from abc
      

  3.   

    select bh,mc,sl,dj,je from abc group by bh,mc,sl,dj
    union all 
    select null as bh,null as mc,null as sl,null as dj,sum(je) as je from abc
      

  4.   

    select b.bh,a.mc,a.sl,a.dj,b.je from
    (select bh,sum(je) je from abc group by bh with rollup) b
    left outer join abc a on a.bh = b.bh
      

  5.   

    这个或许可以:select * from abc compute sum(je)
      

  6.   

    union all即可实现将两个查询合并到一个set中,所以这样子就可以了啊!
      

  7.   

    用compute sum(je)不行的 不能显示在一起