删除主键

阅读 57

2023-07-02


删除表中已有的主键约束


(1)有命名


 alter table students drop constraint yy;


(2)无命名


可用 SELECT   *   from   user_cons_columns;


查找表中主键名称得student表中的主键名为SYS_C002715


alter table student drop constraint SYS_C002715; 

 

  or 

 

  alter table ptrs_config drop primary key


 


3、向表中添加主键约束


alter table student add constraint pk_student primary key(studentid);

精彩评论(0)

0 0 举报