Hi everyone,
I hope you can help me with my SQL Problem.
I created the Table Cases and selected my Case Key and a specific filtering for “Specific Type”.
The strange thing is that my output includes two lines but in my row data the conditions are matched for ‘Text1’.
DROP TABLE IF EXISTS “CASES”;
CREATE TABLE “CASES” AS(
SELECT DISTINCT
“B”.“ID” AS “CASE_KEY”,
CASE
WHEN “B”.“EX” = 5 AND “B”.“VW” = 4
THEN ‘Text1’
ELSE ‘next’
END AS “Specific Type”
FROM “Data” AS “B” );
SELECT * FROM “CASES” WHERE “CASES”.“CASE_KEY” =‘722’
OUPUT:
CASE_KEY Specific Type"
722 Text1
722 next
Does someone know how why I still get next as a output and how can I change the syntax to get sure to get out only Text1?