The tree tag has no wiki summary.
15
votes
3answers
2k views
Traversing tree-like data in a relational database using SQL
Is there a way to traverse tree data in SQL? I know about 'connect by' in Oracle, but is there another way to do this in other SQL implementations? I'm asking because using 'connect by' is easier ...
5
votes
2answers
523 views
How to structure a model to properly and efficiently represent tree-like data on relational databases?
Based on Traversing tree-like data in a relational database using SQL question, I would like to know how the way regularly used to describe tree-like data on relational databases considering physical ...
4
votes
1answer
121 views
Modelling Hierarchical attributes
I am trying to figure out the data model for a retailer.
The retailer has several stores across the country and they are modeled using the following hierarchy:
Channel -> Zone -> City -> ...
2
votes
1answer
505 views
How to traverse a tree in SQL? Sybase edition [duplicate]
Possible Duplicate:
Traversing tree-like data in a relational database using SQL
Whats the best way to traverse a tree in sybase?
Basically, what I want is to gather all the decedents of a ...
2
votes
1answer
860 views
PostgreSQL tree structure and recursive CTE optimization
I'm trying to represent a tree structure in PostgreSQL (8.4) to be able to query the path from the root to a given node or to find all the nodes within a sub-branch.
Here is a test table:
CREATE ...
1
vote
2answers
740 views
Loop through Self JOIN on table until the operand column is NULL completely
For the problem I have a single table which store a Member's ID and His Referee's ID. This is something like a Multi-Level-Marketing plan where you join a company for some tasks and then someone join ...
0
votes
1answer
131 views
Combining a tree structured Group model with its HABTM User model in one VIEW
I have a tree structured model Group which has the columns id, parent_id, name, lft and rght. I also have a model User which has the columns id, name and password. Group and User have a ...
0
votes
2answers
98 views
Performing SELECT on EACH ROW in CTE or Nested QUERY?
This is a problem in PostgreSQL
I have a table which stores the tree of users;
+------+---------+
| id | parent |
|------+---------|
| 1 | 0 |
|------|---------|
...
0
votes
0answers
60 views
Prefix traverse of a tree
I have a table with tree data as it defined in this question and have to implement traversal of the tree that looks like preorder traversal but instead of root --> left subtree --> right subtree ...
-1
votes
2answers
118 views
Information sources for multiple hierachy trees in a single table
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 ...