add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version()
5.7.32
id origin order_id createdAt product_id amount
1 1 11 2020-12-22 234 2000
2 1 11 2020-12-22 235 3000
3 1 11 2020-12-22 236 4000
4 2 12 2020-12-22 236 3000
5 2 12 2020-12-22 235 2100
6 3 13 2020-12-22 236 2200
7 3 13 2020-12-22 239 3400
8 4 14 2020-12-22 237 2300
9 4 14 2020-12-22 233 4000
id product_id reprintAt status
1 234 2020-12-23 11:20:33 1
2 235 2020-12-24 11:20:33 1
3 236 2020-12-22 11:20:33 1
4 237 2020-12-22 11:20:33 1
5 238 2020-12-22 11:20:33 1
6 239 2020-12-22 11:20:33 1
7 240 2020-12-22 11:20:33 1
8 233 2020-12-22 11:20:33 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DECLARE test_1 INT DEFAULT 0;
DECLARE test_2 INT DEFAULT 0;

SELECT count(distin' at line 1