且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

引用表中没有主键或候选键

更新时间:2023-11-24 13:09:40

如果要创建外键,它必须引用主键或具有唯一约束的字段.

If you want to create a foreign key, it must reference either the primary key, or a field with a unique constraint.

如果你想显示客户的名字,让外键引用CustomerID,然后用join来显示结果.

If you want to display the customer's name, make the foreign key reference the CustomerID, and display the results with a join.