Deviopath › PostgreSQL

Price Labels

Easy · SELECT Basics

CASE WHEN condition THEN value ... ELSE value END picks a value for each row. The first WHEN that is true wins.

For every product, return name and price_label: - 'cheap' when price is below 10 - 'regular' when price is from 10 up to (but not including) 100 - 'premium' otherwise

Next: Orders in March 2026