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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 re: problem with display of matrix salary sum

Author  Topic 

msa969
Starting Member

13 Posts

Posted - 2001-10-27 : 11:43:13
I have an employer table

empno | job | salary | deptno

How could I create a matrix to display?
1) Job
2) Total salary for each department i.e. 1-4
3) Total for all 4 departments for each job

i.e.

Job Deptno 10 Deptno 20 Dptno 30 Total
----- --------- --------- --------- ------
Analyst 45000 45000
Clerk 30000 30000 30000 90000
... ... ... ... ...


   

- Advertisement -