Use standard SQL in a two-step process to insert new rows and update existing rows. The following is one way to do this, but this is not the best way:
t1 (a, b, c)
l.d, l.e, l.f
t2 l t1 r l.d = r.a
r.a - ;
t1 l t2 r l.a = r.d set l.b = r.e, l.c = r.f;