By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
select @@version;
(No column name) |
---|
Microsoft SQL Server 2019 (RTM-CU16) (KB5011644) - 15.0.4223.1 (X64) Apr 11 2022 16:24:07 Copyright (C) 2019 Microsoft Corporation Express Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor) |
CREATE table transactions (
client_id INTEGER NOT NULL,
is_cancelled TINYINT,
date DATE NOT NULL
);
INSERT INTO transactions (client_id, is_cancelled, date)
VALUES
(1, 0, '2022-01-01'),
(1, 1, '2022-01-01'),
(1, 1, '2022-01-02'),
(1, 1, '2022-01-04'),
(1, 0, '2022-01-05'),
(1, 1, '2022-01-06'),
(2, 0, '2022-01-01'),
(2, 0, '2022-01-02'),
(2, 0, '2022-01-03'),
(2, 0, '2022-01-04'),
(2, 1, '2022-01-05'),
(2, 1, '2022-01-06'),
(2, 0, '2022-01-07'),
(2, 1, '2022-01-08')
14 rows affected