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
 Query ragarding Table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-09-19 : 07:43:48
faisal writes "suppose table as EMP columns as EMPID ,NAME, SALARY, DEPARTMENT

suppose Emp of 10 records & a person have two diffrenet records having in two diffrent DEPARTMENT,


How would I get SUM OF salary of FAISAL who is in two diffrent DEPARTMENT.

EMPID EMPNAME SALARY DEPARTMENT

1 FAISAL 2000 COMPUTER
2 AHMED 3000 CIVIL
3 ABDUL 4000 ELECTRICAL
4 ATEEQ 5000 MECHANIC
5 FAISAL 1000 civil"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-09-19 : 07:45:27
Suppose you try to figure out the correct SQL on your own, instead of asking people to do your homework for you.

You've already got half of it with SUM, playing around with that should at least give you enough error messages to figure it out.
Go to Top of Page
   

- Advertisement -