null values
null values
I have the following table
Amount Category Sub category
$5.00 Entertainment
$5.00 Groceries
$5.00 Entertainment Entertainment-Lunch
I have a SQL table that tries to spit out a pivot like table
SELECT
CASE "Sub-Category" WHEN NULL THEN "Amount" ELSE 0 END AS "Unclassified",
CASE "Sub-Category" WHEN 'Entertainment-Lunch' THEN "Amount" ELSE 0 END AS "Lunch",
"Amount",
FROM "t_expenses" WHERE "Category" = 'Entertainment'
this should output
Unclassified Lunch Amount
$5.00 $5.00
$5.00 $5.00
instead, I get:
Unclassified Lunch Amount
$5.00 $5.00
Is it possible to recognize a "null" Sub-category? The empty string '' did not work either.