数据库表新建字段如何调整位置
一、新增字段
alter table [table_name] add [column_name] [column_type]
二、查询出你要调整的表的ID
select
object_id
from all_objects
where owner = 'schema'
and object_name = 'table_name' ;
三、根据id去查询该表中的字段以及字段序号
select
obj#
,col#
,name
from sys.col$
where obj# = '第二步查出来的object_id'
四、可以用update语句来任意调整字段的顺序
update sys.col$ set col# = ? where name = '你想调整位置的字段名'