|
-
May 12th, 2008, 09:24 AM
#1
Thread Starter
Lively Member
Get SUM of a field on a different table
Hello!
I am using SQL Server 2000. I have two tables. The first table is the list of employees (EMP_ID, firstname, lastname, etc). The second table is their production everyday( ID , WORDCOUNT, LINECOUNT, DURATION, etc)
wordcount and linecount are numbers while duration is hr:mm:ss
EMP_ID is the same with ID. Primary and foreign key.
I have a question. What is the proper SQL for getting the total sum of wordcount, linecount and duration from the other table.
I know the SUM() function of SQL and the Inner Join but i dont know how to combine them.
My desired output is the Employee's list (no duplicate) from table one plus the total sum of the three field from the other table.
TIA.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|