vendredi 24 juin 2016
Insert data in SQL table having primary and foreign key in the same table [duplicate]
This question already has an answer here:
can foreign key refer to primary key in same table?
2 answers
I have one table having two columns ID1 and ID2. ID1 is primary key and ID2 is foreign key of ID1 column. The problem is user wants to insert data in table given below
ID1 (PK) ID2 (FK)
1 2
2 3
3 4
4 1
Is it possible, one is to using update is there any other way
FK is not null.
and need to insert all the data in one sql query.
The link provided for the same question , i already visit that link . In that question FK is null and they don't insert all record in one sql query.
Over to all this what i say is PK =1 and same time FK=2 , which is not possible what i have read in books. So this question is totally different from above question.
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire