Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular

SQLize.online is a free online SQL environment for quickly running, experimenting with and sharing code. You can run your SQL code on top of the most popular RDBMS including MySQL, MariaDB, SQLite, PostgreSQL, Oracle and Microsoft SQL Server.

Copy Format Clear
; with pt as (select year(payment_date) income_year, name staff, sum(amount) total_paiments from payment P join staff_list SL on P.staff_id=SL.id group by income_year, staff with rollup) select income_year, case when staff is null and income_year is not null then 'Year total' when staff is null and income_year is null then 'Total' else staff end staff, total_paiments from pt

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear