with cte as(
SELECT YEAR(p.payment_date) AS income_year,
CONCAT(s.last_name, ' ', s.first_name) AS staff,
SUM(p.amount) AS total_payments
FROM payment p
JOIN staff s USING(staff_id)
GROUP BY income_year, staff WITH ROLLUP)
SELECT IFNULL(cte.income_year,'Total') AS income_year, IFNULL(cte.staff,'Year total') AS staff, cte.total_payments
FROM cte