SQLize
Online
/
PHPize Online
/
SQLtest Online
A
A
A
Share
Donate
Blog
Popular
Donate
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.
SQL code:
Upload
Copy
Format
Clear
with cte_upd_currency as ( select c1.id , c1.updated , c2.name , c2.rate_to_usd from (select id , max(updated) as updated from currency group by id) as c1 join currency as c2 on c2.id = c1.id and c2.updated = c1.updated ) select coalesce(u.name,'not defined') as name , coalesce(u.lastname,'not defined') as lastname , b.type as type , sum(b.money) as volume , coalesce(cte_uc.name,'not defined') as currency_name , coalesce(cte_uc.rate_to_usd, 1) as last_rate_to_usd , sum(b.money) * coalesce(cte_uc.rate_to_usd, 1) as total_volume_in_usd from balance as b full join public.user as u on u.id = b.user_id left join cte_upd_currency as cte_uc on cte_uc.id = b.currency_id group by u.id, b.type, cte_uc.name, cte_uc.rate_to_usd order by name desc, lastname, type ;
SQL
Server:
MySQL 5.7
MySQL 5.7 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
MariaDB 11.5
SQLite 3
SQLite 3 Preloaded
PostgreSQL 10 Bookings (ReadOnly)
PostgreSQL 11
PostgreSQL 12
PostgreSQL 13
PostgreSQL 14
PostgreSQL 15
MS SQL Server 2017
MS SQL Server 2019
MS SQL Server 2022
MS SQL Server 2022 AdventureWorks (ReadOnly)
Firebird 4.0
Firebird 4.0 (Employee)
Oracle Database 19c (HR)
Oracle Database 21c
Oracle Database 23c Free
SOQOL
Version
ER Diagram
Preserve result
Stuck with a problem?
Got Error?
Ask ChatGPT!
Result:
Copy
Clear