当前位置:网站首页>The data in the database table recursively forms a closed-loop data. How can we get these data

The data in the database table recursively forms a closed-loop data. How can we get these data

2022-07-01 14:47:00 CSDN Q & A

 

First of all, there is a table in the database , There are two key fields ,targetIden and srcIden, These two fields are used to mark a relational data that can theoretically be used as a parent-child , Can be interpreted as targetIden Is the parent node data ,srcIden Is the child node data , As shown in the figure , Suppose you insert a piece of data ( Ending with …55 and …411 The data of , Recursively form a closed loop with the data in the table ), How can we get all the closed-loop data like recursion ,sql Can grammar be realized




Take the answer :

The title owner is now using IDE yes DBeaver Right , It's best to talk about what database you use , About recursive processing , The processing methods of various databases may be different , Need specific analysis , in addition , What will the final data show like ? Two fields , One is the smallest child node , In the other field, are all the parent nodes up this child node ?


原网站

版权声明
本文为[CSDN Q & A]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202090854556540.html