SELECT SUM(CASE WHEN PercentChange >= 0 AND PercentChange <= 10 THEN 1 ELSE 0) END AS ZeroTen,
SUM(CASE WHEN PercentChange > 10 AND PercentChange <= 20 THEN 1 ELSE 0) END AS TenTwenty,
SUM(CASE WHEN PercentChange > 20 AND PercentChange <= 30 THEN 1 ELSE 0) END AS TwentyThirty
FROM MagicChangeTable
Catatan:MagicChangeTable
mungkin sebenarnya adalah subquery untuk menghitung persentase perubahan.