sql - Oracle SQL:如何复制一行并修改语句中的某些值?
问题描述
Oracle SQL:如何复制一行并修改语句中的某些值?大约有 50 列
我正在考虑将一行复制到临时表中修改临时表中的值插入到现有表中
但我想知道是否有更好的方法
解决方案
您只需使用insert . . . select
:
insert into t (col1, col2, col3, . . .)
select col1, <whatever expression you want>, col3, . . .
from t
where . . . ;
推荐阅读
- asp.net-mvc - 出现错误“此命令只能在通过 CLI 运行时在 CLI 项目错误中运行”
- c++ - 如何在我自己的 Arduino 库中使用外部库?
- c# - 处理较长的下载时间
- c - gcc 命令中的 .o 文件是什么?
- vba - 32809 应用程序定义或对象定义错误
- jaxb - JAXB 解组无法返回具有替代组的元素
- azure-devops - VSTS API - 存储库创建日期
- ios - uitableview:在同一行中,选定的按钮应自动选中,其余按钮应自动取消选中
- javascript - npm start 运行错误“var before = prev.prev || {}; TypeError:无法读取未定义的属性'prev'”
- javascript - 拖放时时间轴中的光标位置问题