oracle 主鍵刪除,聯合主鍵的建立

2021-09-06 18:48:41 字數 435 閱讀 2990

alter table tablename drop primary_key

執行上面的sql能夠刪除主鍵;假設不成功能夠用

alter table tablename drop constraints column cascade; --刪除約束

alter table tablename disable primary_column ; --設定被設定為主鍵的列為無效

drop index index_name; --刪除主鍵索引

select * from user_constraints where constraint_type='p' and table_name='你要檢視的表名'  and owner=user

alter table add constraints '約束名'   primary key (column,column,...);

刪除具有聯合主鍵的記錄

delete t1 from datatower all dwd com team training rf t1 left join datatower all tmp dwd com team training rf t2 on t1.poi id t2.poi id and t1.trainin...

MySQL聯合主鍵儲存 mysql聯合主鍵

聯合主鍵就是多個表的主鍵聯合起來作為乙個表的主鍵 這個是摘抄的別人的 create table products description products id int 11 not null,language id int 11 not null default 1 products name v...

sql 設定主鍵 聯合主鍵

alter table yourtable add constaintname primary key columnname constaintname 資料型別 yourtable 表名 columnname 列名 or create table yourtable column1 int pri...