Just use conditional aggregation:
select sum(case when hits < 10 then hits else 0 end),
sum(case when hits > 10 then hits else 0 end)
from t;
Note: The results do not include rows where hits = 10
. You might want <=
or >=
if you want to include these.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…