I have code that gets me the last time a staff logged in to the system.
First Query: select max(a.session_start) as session_start, max(a.session_end) as session_end, b.last_name, b.first_name from use_log_with_transactions_view a inner join staff_view b on a.staff_id = b.staff_id group by b.last_name, b.first_name order by b.last_name, b.first_name
But i need to get the worker_role the staff has. Can I integrate the below query with the one above? I need the worker_role bec I need to filter the report.
To do that I would use this query:
select a.last_name, a.first_name, c.description from staff_view a
left join staff_worker_role_link_view b
on a.staff_id = b.staff_id
inner join worker_role c
on c.worker_role_id = b.worker_role_id