wood burning stoves 2.0*
The moose likes Oracle/OAS and the fly likes mystery on why compute oonly calculates for Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "mystery on why compute oonly calculates for "Total" column" Watch "mystery on why compute oonly calculates for "Total" column" New topic
Author

mystery on why compute oonly calculates for "Total" column

sid alam
Greenhorn

Joined: Dec 01, 2001
Posts: 27
I have an employer table with the following columns
employer
DepartNo | EmployerName | Salary | Commission | Job
How comes I am not able to calculate total for salary and commision but it calculates the total(sum) for "Total"???

col my_column1 HEADING 'Monthly Salary'
col my_column2 HEADING 'Annual Commission'
BREAK on DepartNo skip 1
compute SUM OF my_column1, my_column2, total ON DepartNo
select DepartNo , Job "Job", employerName "Name", Salary my_column1 , Commission my_column2, sal*12+(nvl(comm,0)) "Total" from employer
order by deptno;
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mystery on why compute oonly calculates for "Total" column