Input Data:
Store Sales
11 2.5
12 null
13 0.0
14 5.2
Problem Statement: From above mentioned data, have to check if Sales value is null and <> 0, assign Y in new column named Ignore else leave empty.
Expected Output:
Store Sales Ignore
11 2.5
12 null Y
13 0.0 Y
14 5.2
Tried SQL Query:
SELECT
*,
CASE WHEN t.Sales IS NULL AND t.Sales <> 0 THEN 'Y' ELSE '' END Ignore,
FROM TABLE1 t
While doing so all value of Ignore column is empty. Not sure where I'm going wrong. Need Help. Thanks in Advance!
