对于H2,有两种选择.第一个适用于所有数据库:
update tlegacy lca set
lca.pr_dato = (select ca.calc_holdings_date ... from tca ca where ...)
where lca.id in (select ca.id from tca where ...)
Run Code Online (Sandbox Code Playgroud)
第二个选项是使用非标准MERGE语句.如果尚未存在具有此键的行,它将插入新行.
merge into tlegacy(pr_dato) key(id)
select ca.calc_holdings_date, ca.id from tca ca where ...
and exists (select * from tlegacy where ...)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
6210 次 |
最近记录: |