Re: Compute in Oracle

From: Mahesh Rajendran <Magvivek_at_gmail.com>
Date: 22 Feb 2005 13:54:07 -0800
Message-ID: <1109109247.587850.198010_at_o13g2000cwo.googlegroups.com>


the options are limited with sql*plus formatting commands

  1* select job,sum(sal) sum_sal, trunc(avg(sal)) avg_sal from emp group by job

mag_at_mutation > break on report
mag_at_mutation > compute avg of avg_sal on report
mag_at_mutation > compute sum of sum_sal on report
mag_at_mutation > /

JOB          SUM_SAL    AVG_SAL
--------- ---------- ----------
ANALYST         6000       3000
CLERK           4150       1037
MANAGER         8275       2758
PRESIDENT       5000       5000
SALESMAN        5600       1400
          ---------- ----------
avg                        2639
sum            29025
Received on Tue Feb 22 2005 - 22:54:07 CET

Original text of this message