SQL QUERY仅限唯一

时间:2014-03-26 04:16:47

标签: mysql

您好,并提前致谢!

SELECT employeeID, employeeFirstName, employeeLastName, eventID
FROM (
SELECT employee.employeeID, employeeFirstName, employeeLastName, position.positionID, position.employeePosition, eventID
FROM employee

LEFT JOIN event
ON employee.employeeID=event.employeeID

LEFT JOIN position
ON employee.positionID=position.positionID
) s
WHERE employeePosition = 'Photographer' 
;

返回:

http://tinypic.com/r/ja9nup/8

如何将a列设为每个员工完成的事件总数?这意味着每个员工只展示一次,他们所做的eventID数量总计是多少?

0 个答案:

没有答案