This SQL gives you the number of tickets your staff members have worked on:
Code:
SELECT swstaff.fullname,
(SELECT COUNT(DISTINCT swticketposts.ticketid) FROM swticketposts where swticketposts.staffid = swstaff.staffid) as tickets
FROM swstaff
ORDER BY tickets DESC