mysql操作

1、已有表創建表外鍵:

alter table 表名 add constrain FK_約束名 foreign key([外鍵列]) references 主鍵表([主鍵列])

e.g

alter table cst_customer add constraint fk_industry_002 foreign key(cust_industry) references base_dict (dict_id);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章