I think this query could be simplified.
when global >= 4.00 then 'high'
when global > 2.00 and global <= 3.99 then 'mid'
else 'low' end
as 'Sales Range'
WHEN global >= 4.00 THEN 'high'
WHEN global > 2.00 THEN 'mid'
END AS [Sales Range]
You don't really need to check if global is equal or less than 3.99 because you're already in another condition.
Numbers like 3.995 would become low as well.
No. 3.995 is not gte 4.00 so it moves to the next check. It IS greater than 2. So mid
I was pointing at the first snippet, which has two conditions to check for mid.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.