--根据指定节点ID获取所有子节点-- WITH TEMP AS ( SELECT * FROM table_name WHERE Id=' --表的主键ID UNION ALL SELECT T0.* FROM TEMP,table_name T0 WHERE TEMP.Id=T0.ParentId --子级ID==父级ID ) SELECT * FROM TEMP; --根据指定节点ID获取所有父节点-- WITH TEMP AS ( SELECT * FROM table_name WHE…
--根据指定节点ID获取所有子节点-- WITH TEMP AS ( ' --表的主键ID UNION ALL SELECT T0.* FROM TEMP,table_name T0 WHERE TEMP.Id=T0.ParentId --子级ID==父级ID ) SELECT * FROM TEMP; --根据指定节点ID获取所有父节点-- WITH TEMP AS ( ' --表的主键ID UNION ALL SELECT T0.* FROM TEMP,table_name T0 WHERE…
--------------------01.向上查找所有父节点-----------------WITH TEMP AS (SELECT * FROM CO_Department WHERE ID=11 --表的IDUNION ALL SELECT T0.* FROM TEMP,CO_Department T0 WHERE TEMP.ParentID=T0.ID --父级ID==子级ID)SELECT * FROM TEMP; 如图:根据"测试组"查找所有父节点 执行结果…
最近工作中总遇到取各种父啊子啊兄弟姐妹啊,每次都得查,这次整理个全乎的~ [js的获取方式] function dom(){ var a = document.getElementByIdx_x_x("dom"); var b = a.childNodes; 获取a的全部子节点 var c = a.parentNode; 获取a的父节点 var d = a.nextSbiling; 获取a的下一个兄弟节点 var e =…