Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- A.FirstName,
- A.LastName,
- A.EmployeeID,
- A.TimePerPhone,
- A.PhonesPerDay,
- B.PhonesToday
- FROM
- (SELECT
- A.FirstName,
- A.LastName,
- A.EmployeeID,
- AVG(B.Timer) AS TimePerPhone,
- COUNT(DISTINCT B.AuditID) AS PhonesPerDay,
- DATE(B.AuditDate) AS AuditDate
- FROM
- EmployeeTable AS A,
- AuditTable AS B
- WHERE
- A.EmployeeID = B.EmployeeID
- GROUP BY
- A.FirstName,
- A.LastName,
- A.EmployeeID,
- AuditDate
- ORDER BY
- AuditDate DESC
- ) AS A
- GROUP BY
- A.FirstName,
- A.LastName,
- A.EmployeeID,
- ORDER BY
- PhonesToday DESC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement