T-SQL use CASE statement

SQL Add comments

Select with CASE (SQL only)
 SELECT title, price, Budget =
   CASE price
          WHEN price > 20.00 THEN ‘Expensive’
           WHEN price BETWEEN 10.00 AND 19.99 THEN ‘Moderate’
           WHEN price < 10.00 THEN ‘Inexpensive’
           ELSE ‘Unknown’
          END, FROM titles

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in