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
 SQL Server Development (2000)
 re: problem with sql query total for each group per dept.

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-11-01 : 09:06:44
Dek writes "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 -