Home >Database >Mysql Tutorial >mysql有没有递归查询?

mysql有没有递归查询?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 09:40:311328browse

mysql递归查询

<code>  RT.有一张表,维护几个对象的删除关系。3个字段,objectA, type,objectB.表示ObjectA关联哪些ObjectB要删除。type表示删除类型,0代表级联删除,1代表断开关系。级联删除要继续查询,以ObjectB为条件查询它又关联哪些要删除。直到没有关联要级联删除的对象为止。断开关系不用继续查询。        ObjectA        type          ObjectB         obj1              0                  obj2         obj1              0                  obj3         obj1              1                  obj4             如上表,obj2和obj3要继续作为条件成为ObjectA来查询,直到type都是1为止。</code>
Statement:
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