Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 Other Topics
 mstery how compute works on "Total" but not on Sal

Author  Topic 

Dek
Starting Member

7 Posts

Posted - 2001-12-07 : 18:48:49
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 DepartNo;

robvolk
Most Valuable Yak

15732 Posts

Posted - 2001-12-07 : 19:55:54
Dek-

This is not SQL Server code. We only cover Microsoft SQL Server on this site. We might be able to point you to another resource if you let us know which software you're using.

Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2001-12-08 : 03:33:34
It was Oracle last time he posted it, so it's probably still Oracle.

Go to Top of Page
   

- Advertisement -