update table1 a set a.col1='Y' where exists(select 1 from table2 b where a.col1=b.col1 and a.col2=b.col2 )