oracle修改字段和字段類型

語句:
alter table tableName rename column oldCName to newCName; -- 修改字段名
alter table tableName modify (cloumnName 數據類型); -- 修改數據類型table

例如:
一、建立表:
  CREATE TABLE Student(
    id varchar2(32) primary key,
    name varchar2(8) not null,
    age number
  );
二、修改字段名:
  alter table Student rename name to StuName;
三、修改數據類型:
  alter table Student modify (id varchar2(64));數據類型

相關文章
相關標籤/搜索