Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 oracle SQL 表,我想复制它的行,同时增加每行的 id 并更改 2 列的值。所以伪代码会是这样的:
for each row r in TABLE t new n = r n.id = r.id+1 n.columnA = 12 n.columnB = 13 insert n into t
有人可以展示我将如何在 Oracle SQL 中执行此操作吗?
insert into t(id, columnA, columnB) select id + 1, 12, 13 from t;