I really baffled on why this simple case statement will not work.
SELECT avg_weight,
CASE avg_weight
WHEN avg_weight BETWEEN 0 AND 2000 THEN 'data'
ELSE 'No Data'
END AS wt_type
FROM tbl_prices;
results are like this:
avg_weight wt_type
1050 No data
833 No data
990 No data
The column is avg_weight, smallinit(4)
If I change the value of 1050
to 0
, then I get data in the wt_type
column
I have also tried
WHEN avg_weight > 0 AND avg_weight < 2000 THEN 'data'
but I get the same results.