Using pubs db I have created the following with UNION ALL, but was trying to do the same with a CASE stmt.
SELECT
t.title_id AS 'Title ID',
t.ytd_sales 'YTD Sales',
t.price AS 'Original Price',
'New Price' = CASE t.ytd_sales
WHEN (t.ytd_sales < 2500.00) THEN CONVERT(DECIMAL(9,2),ROUND (t.price*1.15,2))
WHEN (t.ytd_sales BETWEEN 2500.00 AND 10000.00) THEN CONVERT(DECIMAL(9,2),ROUND(t.price*1.10,2))
WHEN (t.ytd_sales > 10000.00) THEN CONVERT(DECIMAL(9,2),ROUND(t.price*1.05,2))
ELSE CONVERT(DECIMAL(9,2),ROUND(t.price*1.00,2))
END
FROM titles t
;
It does not like to comparison/special operators. is this even possible to do as a CASE stmt? Thanks