如果是ORACLE,外键字段的值必须是主表中的字段值中的一个,或者为空。
“The relational model permits the value of foreign keys either to match the referenced primary or unique key value, or be null. ”
-《ORACLE8i Concepts》第28章 Data Integrity
“The relational model permits the value of foreign keys either to match the referenced primary or unique key value, or be null. ”
-《ORACLE8i Concepts》第28章 Data Integrity
它代表unknown.当然与“”不一样了。
主表的外键是从表的主键
试问你能在从表中增加一条主键为null的记录吗
试问你能在从表中增加一条主键为null的记录吗 ??”
那在从表中出现外键重复又怎么解释?试外你能在从表中增加一条主键重复的记录吗?
update tablename set field=null where ...