What is the best way to store a binary search tree in Mysql ? Should each node be a table ?
Asked
Active
Viewed 1,153 times
1 Answers
1
Create a table with a circular reference.
CREATE mytable(
id int not null auto_increment,
parent_id int,
PRIMARY KEY (`id`)
);

Robert Harvey
- 178,213
- 47
- 333
- 501
-
What would be the best way of selecting a subtree ? – donquixote Aug 08 '14 at 18:17