SELECT aa.id AS `Staff ID` , CONCAT( ad.firstname, ' ', ad.lastname ) AS `Staff Member` , COUNT( t.id ) AS `Unresolved Tickets Count`
FROM hb_admin_access aa
JOIN hb_admin_details ad ON ( aa.id = ad.id )
JOIN hb_tickets t ON ( t.owner_id = aa.id )
WHERE t.status!='Closed'
GROUP BY t.owner_id