Really Good one, Hugo, thank you for posting (so basic and so much of valuable point)
(Not sure and can't think of why one would use as "BETWEEN -1 AND -10" with "start" as the higher value in any practical case. When I saw -1 as the start value.. I thought that might be the catch here and .... 🙂 )
SELECT KeyCol, ValueCol, CASE
WHEN ValueCol < -10 THEN 'Very negative'
WHEN ValueCol BETWEEN -10 AND -1 THEN 'Bit negative'
WHEN ValueCol = 0 THEN 'Zero'
WHEN ValueCol BETWEEN 1 AND 10 THEN 'Bit positive'
ELSE 'Very positive'
END AS Category
SELECT 1 [KeyCol], 0 [ValueCol]
SELECT 2, 4
SELECT 3, -15
SELECT 4, 14
SELECT 5, -2
ORDER BY 2
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.