create table SQLU_TEST(ID number,name varchar2(100));
insert into SQLU_TEST
select 1 id,‘S1‘ name from dual
union
select 2 id,‘S2‘ name from dual
union
select 3 id,‘S3‘ name from dual
union
select 2 id,‘S2‘ name from dual;
select * from SQLU_TEST
单条SQL是否就一定不行呢?
from sqlu_test b where b.id=1
union
select id,(select max(name) from sqlu_test a where a.id= 1) newname
from sqlu_test b where b.id=2
) t
on (t.id=st.id)
when matched then update set st.name=t.newname;
主题授权提示:请在后台主题设置-主题授权-激活主题的正版授权,授权购买:RiTheme官网
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。