请问 预排序遍历树算法(非递归无限极分类算法) ,删除一个分支节点和它所有的子节点有关问题

WBOY
Release: 2016-06-13 12:09:51
Original
1220 people have browsed it

请教 预排序遍历树算法(非递归无限极分类算法) ,删除一个分支节点和它所有的子节点问题



删除一个分支节点和它所有的子节点,从网上看到一段代码,发现这个是错的,
请教一下,这个怎么写SQL,谢谢!
------解决思路----------------------

delete from food where lft>=当前节点的lft AND rgt <= 当前节点的rgt
Copy after login
 
------解决思路----------------------
UPDATE nested_category SET lft = lft - @myWidth WHERE lft > @myRight
应该为
UPDATE nested_category SET lft = lft - @myWidth WHERE lft > @myLeft

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!