sql - Oracle Recursive Join - Many to Many Relationship -


I have been trying for hours without success, to myself constantly connecting to a table. This is probably the easiest to see the problem in SQL Friedalle, instead trying to explain the connection of adding me:

In the above example, the actual data Nesting up to 5 layers can be deep, maybe more I would like to write a query that is found in many layers.

From some searches, it seems that it is possible to consistently engage in data with previously linked data, and other methods. I am not able to work it :( If one of you can show me how to do this, then it will be horrible.

In order to copy your table from SQL Flood to others to see that the external link is invalid in the future:

  * DEVICE TABLE DEVICEID DEVICENAME ----------------- 1 Device 1 2 Device 2 3 Device 3 4 Device 4 5 Devices 5 6 Devices 6 7 Devices 7 8 Devices 9 9 Devices 9 10 D Vice 10 * Connection table known IDBIL --------- ------- 1 2 3 4 4 6 6 7 7 8 4 8 4 8 5 9  

I do not know what data you want to check from tables, but if you're worried about yourself - using "Connect" already connected, you can go here:

  Separate D. Divisis, D. Devisanam, Connect_byte (device) Select device from root device D Skip on connection c (d.deviceid = C.idchild) first starts from d.deviceid = c.idparent to c.idparent. .devicei D is empty order by d  

, note that 11 queues are returned from this query given in the table that you provided - the reason is that given in your device 8 The hierarchy has two root nodes, 3 and 6.


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -