update table1 set JE =
(
case tabl1.RQ
when 'D1' then table2.D1
when 'D2' then table2.D2
when 'D3' then table2.D3
when 'D4' then table2.D4
when 'D5' then table2.D5
when 'D6' then table2.D6
when 'D7' then table2.D7
else null
end
)
where table1.GH=table2.GH and table1.Month=table2.Month