Quote:
Originally Posted by amresh23
as is it possible to have a primary key with multiple records and use just one record from this as a foreign key to a next table
|
If I understand your requirement correctly, you have master table T1 with composite primary key ( C1, C2 ) and in child table T2 you want to reference it only on a part of that primary key (say only on column C1).
In that case, it is not possible. In the foreign key definition, there is no notice about "part" - the unique or primary key constraint is stated (and meant to be) in a whole. Just think logically about it - which parent would you pick if there could (and would) be duplicates in the referenced column. The foreign key would make no sense at all, so there would be no reason for stating it.
Now you have two answers. You may pick any one of them, or just run a small test case - two CREATE TABLE statements should not take you long. In fact, you would know the answer now if you did it in the beginning.