![](/img/trans.png)
[英]how to create a table with two primary keys where one is foreign key in one table and the other on another table?
[英]Two foreign keys reference the primary key of another table
所以我有兩張桌子
Person(personID, first_name, last_name);
Relation(relationID, child_personID, parent_personID);
personID 和relationID 都是主鍵。 child_personID 和 parent_personID 都是外鍵。
我想進行查詢,所以我有孩子和父母的名字和姓氏。
child.first_name child.last_name 和 parent.first_name, parent.last_name
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.