A B C
1 a, 1
2 a 1
3 c 0
4 b 0
5 a 1
6 a 1
7 c 0
8 a 1
. . .
CodePudding user response:
SELECT A, B, (SELECT the IF (COUNT (0) & gt;=5, 0) FROM LS_1 WHERE TT TT. B=T.B) C FROM LS_1 T;CodePudding user response:
If slow, add index to B,CodePudding user response:
SELECT A, B, (SELECT the IF (COUNT (0) & gt;=5, 0) FROM LS_1 WHERE TT TT. B=T.B) C FROM LS_1 T;CodePudding user response:
If slow, add index to B,