merge into tbl t using (select a.pk, b.value from (select rownum rn, pk from tbl) a, (select rownum rn, value from (select 23 value from dual union all select 34 value from dual)) b where a.rn = b.rn and a.pk = t.pk) c on (t.pk = c.pk) when matched then update set col1 = c.value;
一个句子你要更新成多个信息,且无规律.你的这些无规律的值是什么.
如何写到这个sql呢.
using (select a.pk, b.value
from (select rownum rn, pk from tbl) a,
(select rownum rn, value
from (select 23 value from dual
union all
select 34 value from dual)) b
where a.rn = b.rn
and a.pk = t.pk) c
on (t.pk = c.pk)
when matched then
update set col1 = c.value;