You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE OR REPLACETABLEBaseDataAS (
SELECT'10'AS my_key,
'20'AS parent_key,
'30'AS payload
)
;
WITH
Example AS (
SELECTc.my_key,
(c.parent_keyIN (SELECT my_key FROM BaseData)) AS parentExists,
p.my_keyIS NOT NULLAS parentExists2,
FROM BaseData AS c
LEFT JOIN BaseData AS p ONc.parent_key=p.my_key
)
SELECT*FROM Example
WHERE parentExists -- fails-- WHERE parentExists2 -- works
;