mysql> create table treeNodes-> (-> id int primary key,-> nodename varchar(20),-> pid int-> );Query OK, 0 rows affected (0.09 sec)mysql> select * from treenodes;+----+----------+------+| id | nodename | pid |+----+----------+------+|
1 | A | 0 ||
2 | B | 1 ||
3 | C | 1 ||
4 | D | 2 ||
5 | E | 2 ||
6 | F | 3 ||
7 | G | 6 ||
8 | H | 0 ||
9 | I | 8 ||
10 | J | 8 ||
11 | K | 8 ||
12 | L | 9 ||
13 | M | 9 ||
14 | N | 12 ||
15 | O | 12 ||
16 | P | 15 ||
17 | Q | 15 |+----+----------+------+17 rows in set (0.00 sec)
mysql> create table treeNodes-> (-> id int primary key,-> nodename varchar(20),-> pid int-> );Query OK, 0 rows affected (0.09 sec)mysql> select * from treenodes;+----+----------+------+| id | nodename | pid |+----+----------+------+|
1 | A | 0 ||
2 | B | 1 ||
3 | C | 1 ||
4 | D | 2 ||
5 | E | 2 ||
6 | F | 3 ||
7 | G | 6 ||
8 | H | 0 ||
9 | I | 8 ||
10 | J | 8 ||
11 | K | 8 ||
12 | L | 9 ||
13 | M | 9 ||
14 | N | 12 ||
15 | O | 12 ||
16 | P | 15 ||
17 | Q | 15 |+----+----------+------+17 rows in set (0.00 sec)