update table1
set
field1 = 'value1'
from
table1
where
field2 = '111'
and
exists(select * from table2 where id=table1.id and field3 = '2222')
set
field1 = 'value1'
from
table1
where
field2 = '111'
and
exists(select * from table2 where id=table1.id and field3 = '2222')
from table1,table2
where table1.field2 = '111'
and table1.id = table2.id
and table2.field3 = '2222' ;
where field2 = '111'
and id in (select id from table2 where field3 = '2222')