oracle 调整表字段的顺序

阅读 48

2023-07-05

--#1 查询表的字段对象ID

select object_id from all_objects where owner = 'ONWER_NAME' and object_name = 'TABLE_NAME';

--#2 根据表字段对象ID获取排序值

select obj#, col#, name from sys.col$ where obj# = '上一步的 object_id' order by col#;

--#3 修改排序值

update sys.col$ set col#='要调整的顺序' where obj#='上一步的obj#' and name='要修改的字段名';


精彩评论(0)

0 0 举报