我有一个表主键为voucher_no (varchar(10))
,我试图从另一个新表创建FK到这个表/列,但是我我得到一个错误:引用表中没有与引用列相匹配的主键或候选键
There are no primary or candidate keys in the referenced table 'apinv_hdr' that match the referencing column list in the foreign key 'fk_invoice_cfdi_x_voucher_apinv_hdr'
我有几个其他FK绑在这个表/列 - 为什么现在这样反应?
什么是新表的主键? –
请品尝两个表的结构以及两个表中的约束 –