Please help.
I have a Select statement pulling all fields A,B,C,D,E from TABLE Z
I have another SELECT Statement pulling from same TABLE Z. But only pulling those that field B = "BAC", "DAS" by creating a new column to differentiate this filter that states " 1 IS BAC". So, if it's BAC or DAS, it shows 1.
I'm thinking a UNION. I need help to writing the correct UNION and WHERE statement
SELECT A,B,C,D,E
FROM Z
LEFT JOIN Z.das
ON Z.key = R.key
SELECT A,B, C,D,E,
1 AS BAC
FROM Z
LEFT JOIN Z.das
ON Z.key = R.key
WHERE B in ("BAC", "DAS")