Join a table to itself

后端 未结 7 1363
Happy的楠姐
Happy的楠姐 2021-01-26 00:15

this is one on my database tables template.

Id int PK
Title nvarchar(10) unique
ParentId int 

This is my question.Is there a problem if i creat

7条回答
  •  感动是毒
    2021-01-26 00:47

    I have seen this done without errors before on a table for menu hierarchy you shouldnt have any issues providing your insert / update / delete queries are well written.

    For instance when you insert check a parent id exists, when you delete check you delete all children too if this action is appropriate or do not allow deletion of items that have children.

提交回复
热议问题