4
TID(主鍵) //無外鍵這裏
表2:
SID (主鍵) //這裏也沒有外鍵
表3:
Tid
Sid
iid(primary key)
foreign key(Tid,Sid) references table1(tid).table2(sid)
In table3 i want to make a composite foreign key or composite foreign key constraint but failed . there are many questions related to this .But none of them seems helpful to me . How can i do that ? Is it valid ? Then what is the syntax of making composite foreign key from two different tables primary key
尚不清楚你想要達到的目標。僅僅爲兩個表創建兩個單獨的外鍵並不容易? – Carlo
我想從兩個不同表中的主鍵創建一個外鍵 –
它不能完成。您只能創建兩個單獨的外鍵,每個外鍵都引用給定表中的一個主鍵。 – krokodilko