add remove split language show hidden hide
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
client_id id is_batch_empty
1 1 t
1 2 f
1 3 t
1 4 t
2 5 f
2 6 t
2 7 t
INSERT 0 7
id empty_count
1 1
2 1
3 2
4 3
5 0
6 1
7 2
SELECT 7
id empty_count
1 1
2 1
3 2
4 3
5 0
6 1
7 2
SELECT 7
TRUNCATE TABLE
client_id id is_batch_empty
1 1 t
1 2 f
1 3 t
1 3 t
2 5 f
2 5 t
2 7 t
INSERT 0 7
id empty_count
1 1
2 1
3 3
5 1
7 2
SELECT 5
id empty_count
1 1
2 1
3 2
3 3
5 1
5 0
7 2
SELECT 7
id sum
1 1
2 1
3 3
5 1
7 2
SELECT 5