Dear All. I'm very new to ASA. I would like to develop an application for my company, it's production company so it requires to have BOM. Let's say I have a table which recursive relationship as follow. bom_master
Just like usual table structure found on the internet, for the parent item, it's parent_item_id contains null. My question is that how to query one single parent item with all it's child (no matter how many level will be) at once? Do I need a stored procedure or this can be done using plain SQL statement? Please give me some samples or hits. Thanks Kongthap |
Have a look at Parts explosion problems. Wow. Save that one for your next book. :)
(07 Apr '12, 12:19)
dejstone
Replies hidden
Hah, hah... there is an example in my last, um, only book. This question is making me think I'll
(07 Apr '12, 17:51)
Breck Carter
FWIW: The cited solution requires recursive common table expressions (CTEs) and as such, requires v9 and above - so for older versions, I guess a stored procedure will be necessary.
(08 Apr '12, 05:57)
Volker Barth
2
Breck has republished the according part of his book in his blog (and I feel free to publish the link:))
(11 Apr '12, 07:37)
Volker Barth
|
Following the question: How fast is "RECURSIVE UNION"? Each level is permanent 'select' and in case of distributed databases with multiple tables ? Any Evaluation Tests...?! As this certainly is a differen question, I'd recommend to ask it as a separate question - and you can of course link to this current FAQ there...
(27 Mar '13, 05:25)
Volker Barth
|