我会稍微重新排列查询....
SELECT duplicates.NumOccurrences, duplicates.userID, users.firstname, users.lastname FROM ( SELECT userID, COUNT(userID) AS NumOccurrences FROM userDepartments GROUP BY userID HAVING COUNT(userID) > 1 ) duplicates INNER JOIN users ON duplicates.userID = users.userID