gpt4 book ai didi

database - Oracle 将列移动到第一个位置

转载 作者:太空狗 更新时间:2023-10-30 01:46:18 26 4
gpt4 key购买 nike

有什么方法可以将 Oracle 表中的列从最后一个位置移动到第一个位置?有人删除了 ID 列,然后重新创建了它。所以现在到了最后,这是一个问题,因为我们的一些 PHP 脚本使用第一列作为标识符(一个抽象模型有超过 100 个其他模型使用这个基础对象......)

另见:

最佳答案

Oracle FAQ说:

Oracle only allows columns to be added to the end of an existing table.

您必须重新创建您的表。

RENAME tab1 TO tab1_old;

CREATE TABLE tab1 AS SELECT id, <the rest of your columns> FROM tab1_old;

关于database - Oracle 将列移动到第一个位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1824654/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com