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
-- создание таблиц CREATE TABLE zp_test ( rec_date nvarchar(50), end_date nvarchar(50), name NVARCHAR(255) NOT NULL, vid_nadbavki nvarchar(255), summa float ) ; INSERT INTO zp_test (rec_date,end_date,name,vid_nadbavki,summa) VALUES('01.01.2023','05.05.2023','руслан','оклад',000), ('01.01.2023','05.05.2023','руслан','проф мастерство',000), ('01.01.2023','05.05.2023','руслан','питание',000) ; CREATE TABLE zp_fact ( rec_date nvarchar(50), end_date nvarchar(50), name NVARCHAR(255) NOT NULL, vid_nadbavki nvarchar(255), summa float ) ; INSERT INTO zp_fact (rec_date, end_date,name,vid_nadbavki,summa) VALUES('06.05.2023','12.12.2023','руслан','оклад',500), ('06.05.2023','12.12.2023','руслан','проф мастерство',400), ('06.05.2023','12.12.2023','руслан','питание',300) ; -- ************* select * from zp_fact; select name, sum(summa) as summa into ##test_sum from zp_test group by name; select name, sum(summa) as summa into ##fact_sum from zp_fact group by name; update zp_fact set name = 'ЗАКРЫТО' where name in (select f.name from ##fact_sum f join ##test_sum t on t.name = f.name where t.summa != f.summa ) ; insert into zp_fact (rec_date,end_date,name,vid_nadbavki,summa) select rec_date , end_date , name , vid_nadbavki , summa from zp_test where name not in (select f.name from zp_fact f) ; select * from zp_fact;
SQL
Server:
MariaDB 11.4
MariaDB 11.5
MariaDB 10
MariaDB 10 Sakila (ReadOnly)
MySQL 5.7
MySQL 5.7 Sakila (ReadOnly)
MySQL 8.0
MySQL 8.0 Sakila (ReadOnly)
SQLite 3
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