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 Gr ( user_id INT, user_inn INT, event_date DATE ); INSERT INTO Gr (user_id, user_inn, event_date) VALUES(100, 987, '2022-06-12'), (101, 988, '2022-06-02'), (122, 789, '2022-06-06'), (103, 895, '2022-06-28'), (104, 999, '2022-06-30'), (107, 877, '2022-06-02'), (122, 789, '2022-06-30'), (141, 932, '2022-06-18'), (122, 547, '2022-06-25'), (107, 877, '2022-06-19'), (107, 687, '2022-06-02'), (107, 877, '2022-07-30'), (141, 932, '2022-07-18'), (122, 789, '2022-07-05'), (122, 766, '2022-07-05'), (122, 722, '2022-07-15'), (107, 554, '2022-06-10'), (107, 555, '2022-06-17'), (107, 554, '2022-06-10'), (141, 102, '2022-06-03'), (141, 922, '2022-06-22'); select * from ( select user_id, extract(year_month from event_date) as ym, user_inn, user_inn != lag(user_inn, 1, user_inn) over ( partition by user_id, extract(year_month from event_date) order by event_date ) as is_changed from Gr ) tmp
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