Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I need some quality sources - books, websites etc. - to educate myself about putting multiple hierarchy trees in a single table using SQL.

I'm looking for some good theoretical and practical information.

share|improve this question
    
See: Models for Hierarchical Data It's MySQL biased but it has basic discussion about the various models and code. –  ypercube Sep 22 '12 at 18:35
    
Can you elaborate on what you mean by "multiple" hierarchy trees? –  Michael - sqlbot Sep 22 '12 at 22:01
    
I know I can put everthing in one tree and use different entry points but I think depending on how I store the data there is possibly a lot of additional data depending on how wide or deep the tree gets. –  Wozilla Sep 22 '12 at 23:18
    
-1 since your question is not clear. If you add some sample data, perhaps your question would be clearer. –  Max Vernon Sep 25 '12 at 18:40
    
I wouldn't be able to explain everything very specifically at this point, and even more vague information wouldn't make things better. ypercube's comment was actually very helpfull. and thank you for the edit. –  Wozilla Sep 25 '12 at 21:11

2 Answers 2

You can put multiple hierarchies in an Oracle table and query it using a hierarchical query. See the documentation.

share|improve this answer

What we have done with LedgerSMB for our business reporting dimensions (each dimension is hierarchical) is to have a dimensions table, and a units table. Each member of the units belongs to a dimension, and we define hierarchy using the self join of (parent, unit_class) references (id, unit_class). This way we have multiple equivalent hierarchies sharing a table.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.