ON clause conditions have the same restrictions as join conditions with the additional restriction that an ON clause cannot specify a subquery.
The following MERGE request is not valid because it specifies a subquery in its ON clause:
MERGE INTO t1
USING t2
ON a1=a2 AND c1 IN (SELECT b2
FROM t2)
WHEN MATCHED THEN
UPDATE SET c1=c2+2;
The following MERGE request is not valid because it specifies an aggregate operator, SUM, in its ON clause:
MERGE INTO t1
USING t2
ON a1=a2 AND SUM(b1)=10
WHEN NOT MATCHED THEN
INSERT (a2,b2,c2);