作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个场景,我们想要更新 oracle 表中的 40 列。 source 是另一个 oracle 表。
例子:
col1 col2 col3
1 null b
2 null 3
目标表:
col1 col2 col3
1 a null
2 b null
更新后
col1 col2 col3
1 a b
2 b 3
注意:只有当它不为空时我们才需要更新..
感谢任何建议。
最佳答案
update target_table tt
set (col1, col2, col3) = ( select nvl(st.col1,tt.col1),
nvl(st.col2,tt.col2),
nvl(st.col3,tt.col3)
from source_table st where st.primary_key = tt.primary_key )
where exists ( select null
from source_table st
where st.primary_key = tt.primary_key
and (st.col1 is not null
or st.col2 is not null
or st.col3 is not null) );
显然,您必须确定主键是什么。我仅将“primary_key”用作指导性指南。
关于sql - 仅当目标表不为空时才更新目标表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17684799/
以下是我更新 tableview 单元格内的 View 高度的代码 override func layoutSubviews() { super.layoutSubviews() l
我是一名优秀的程序员,十分优秀!