MySQL Forums
Forum List  »  General

Re: Modified Preorder Tree Traversal - Advanced question
Posted by: Clive Galway
Date: August 23, 2005 03:29PM

Here is the SQL to make the test data:

CREATE TABLE `regions` (
`region_id` int(10) NOT NULL auto_increment,
`name` text NOT NULL,
`lft` int(10) default NULL,
`rgt` int(10) default NULL,
`zoom` int(2) NOT NULL default '17',
PRIMARY KEY (`region_id`)
) ENGINE=MyISAM;

INSERT INTO `regions` VALUES (1, 'Root', 1, 20, 15);
INSERT INTO `regions` VALUES (2, 'UK', 2, 9, 5);
INSERT INTO `regions` VALUES (3, 'Scotland', 3, 4, 3);
INSERT INTO `regions` VALUES (4, 'England', 5, 8, 4);
INSERT INTO `regions` VALUES (5, 'Surrey', 6, 7, 1);
INSERT INTO `regions` VALUES (6, 'US', 10, 19, 7);
INSERT INTO `regions` VALUES (7, 'Texas', 11, 14, 6);
INSERT INTO `regions` VALUES (8, 'Dallas', 12, 13, 4);
INSERT INTO `regions` VALUES (9, 'Connecticut', 15, 18, 3);
INSERT INTO `regions` VALUES (10, 'Hartford', 16, 17, 2);

Options: ReplyQuote


Subject
Written By
Posted
Re: Modified Preorder Tree Traversal - Advanced question
August 23, 2005 03:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.