0
点赞
收藏
分享

微信扫一扫

oracle 调整表字段的顺序

冶炼厂小练 2023-07-05 阅读 47

--#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 条评论