Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
443 B
20
Indexable
MERGE INTO 
		members tgt
USING
    members_inc src
ON 
    tgt.id = src.id 
WHEN MATCHED and not (
    (tgt.gender, tgt.email, tgt.age) <=> (src.gender, src.email, src.age)
)
    THEN UPDATE SET 
				gender = src.gender, 
				email = src.email, 
				age = src.age 
WHEN NOT MATCHED
    THEN INSERT (
				id,
				age, 
				gender, 
				email
		)
    VALUES (
				src.id,
				src.age,
				src.gender,
				src.email
		)
;

-- ключ FVlyeGncOQ
Leave a Comment