WEBINAR:
On-Demand
Building the Right Environment to Support AI, Machine Learning and Deep Learning
Once you get the hang of the CASE WHEN SQL Statement it can be easy to overuse it. Sometimes you do not need to even use the CASE WHEN Statement at all and you could simply replace it with Boolean logic. Now Boolean logic isn't a predefined topic per se, just an implementation. Take for example this CASE WHEN Statement:
SELECT *
FROM Pricelist_March
WHERE price CASE PriceID
WHEN 0 THEN 300
WHEN 1 THEN 400
END
This can be replaced by the following:
SELECT *
FROM Pricelist_March
WHERE
PriceID = 0 AND price PriceID = 1 AND price
Visit the DevX Tip Bank