So I have two datasets in a database
DF1
ID value
001 A
002 A
003 B
004 C
And I have this other data set as follows
ID content
002 walter
003 hank
So all I want to do is make a Common Table Expression(CTE) in Snowflake where if an ID in DF1 appears in DF2, then a new variable indicates this (1 or 0)
Final result
ID value id_exist
001 A 0
002 A 1
003 B 1
004 C 0