create table person(
id varchar2(32),
username varchar2(34),
age number
)
--插入数据
insert into person values('1','张三',23);
insert into person values('2','李四',25)
--Oracle特有的update更新方法
update person set(username,age)=(select username,age from person where username='张三' )
where username='李四'
对比一下update语句,上面的语句执行的速度更快一些,而且不容易犯错误
update person set
username=(select username from person where username='张三' ),
age=(select age from person where username='张三' ),
where username='李四'