SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
select coalesce(year(p.payment_date), 'Total') as income_year, concat(s.last_name, ' ', s.first_name) as staff, sum(p.amount) as total_year from payment as p left join staff as s on p.staff_id = s.staff_id group by 1, 2 with rollup

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear