I have some tables with two columns column1 and column2 (both string).
I need to use some merge statement there, when I use simple example with ON like this
MERGE
`tableFoo` foo
USING
`tableBar` bar
ON
foo.column1 = bar.column1
WHEN NOT MATCHED THEN INSERT (column1) VALUES (bar.column1)
it works as expected. But when I try to add OR
to my when_caluse
e.g.
ON
foo.column1 = bar.column1 OR foo.column2 = bar.column1
it will throw RIGHT OUTER JOIN cannot be used without a condition that is an equality of fields from both sides of the join.
Is it possible to use OR inside when_clause
? Same error if I use e.g foo.column1 != bar.column1
question from:
https://stackoverflow.com/questions/66061679/merge-statement-with-or-in-when-clause-throws-right-outer-join-cannot-be-used-w 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…