首页 > 解决方案 > Oracle SQL:如何复制一行并修改语句中的某些值?

问题描述

Oracle SQL:如何复制一行并修改语句中的某些值?大约有 50 列

我正在考虑将一行复制到临时表中修改临时表中的值插入到现有表中

但我想知道是否有更好的方法

标签: sqloracle

解决方案


您只需使用insert . . . select

insert into t (col1, col2, col3, . . .)
    select col1, <whatever expression you want>, col3, . . . 
    from t
    where . . . ;

推荐阅读