且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SQL:如何选择物化路径中的所有父节点?

更新时间:2023-02-08 22:22:16

我在@quambo发表的问题中找到了解决方案.在这里:

I've found the solution in the question posted by @quambo. Here it is:

SELECT * FROM table
WHERE ? LIKE id||%
ORDER BY path

装有?"有必要放置到给定节点的路径.

Insted of '?' it is necessary to place the path to the given node.

SELECT * FROM table
WHERE 'a.b.d.e' LIKE id||%
ORDER BY path