第四章 SQL查询之-层次化查询
qq_41629794:
直接报错误
mysql> select * from male_familys;
+-----------+--------+-----------+----+
| person_id | person | father_id | id |
+-----------+--------+-----------+----+
| 1 | 牛逼 | 0 | 1 |
| 2 | 一级.1 | 1 | 2 |
| 3 | 一级.2 | 1 | 3 |
| 4 | 一级.3 | 2 | 4 |
| 5 | 一级.4 | 3 | 5 |
| 6 | 一级6 | 0 | 6 |
+-----------+--------+-----------+----+
6 rows in set
mysql> select * from male_familys start with person='牛逼' connect by prior person_id= father_id;
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'person='牛逼' connect by prior person_id= father_id' at line 1
mysql>
|