select ((select ....)-(select ...)) from dual;

解决方案 »

  1.   

    select a.X - b.Y
    from (select sum(a.charge) x from table1 a,table2 b, table3 c where ...) a,
         (select sum(a.charge) y from table1 a,table2 b, table3 c where ...) b;
      

  2.   

    select sum(a.charge) from table1 a,table2 b, table3 c where ...
    minus
    select sum(a.charge) from table1 a,table2 b, table3 c where ...
      

  3.   

    用 KingSunSha(弱水三千) 的方法
    我用过好用
      

  4.   

    首先请问一下必须要在一个SQL语句实现不可吗?
    从实现上来说肯定能实现,但是效率不行,尤其是项目
    所以我建议你不要使用一个SQL实现