create table zz ( x integer, y integer ) ;
insert into zz values( 1, 2) ;
insert into zz values( 1, 2) ;
insert into zz values( 1, 2) ;
insert into zz values( 1, 3) ;
insert into zz values( 1, 4) ;
select * from zz ;
X Y
1 2
1 2
1 2
1 3
1 4
create table yy as select * from zz ;
update yy set y = 5 where x = 1 and y = 2;
select * from yy ;
X Y
1 5
1 5
1 5
1 3
1 4
update zz set ( x, y ) = ( select x, y from yy where x = zz.x and y = zz.y );
— Before you type in the next bit try and work out what you think will be in zz now
— and try and work out why
select * from zz ;
drop yy ;
drop zz ;