给定路径的唯一子节点(给定路径除外)
查询:
select path from tree where path <@ 'a.b.c';
结果:
预期结果:
a.b.c 以下所有节点(结果不需要 a.b.c)
明确排除确切值怎么样?
select path
from tree
where path <@ 'a.b.c' and path <> 'a.b.c'
或者,您可以使用:
select path
from tree
where path ~ 'a.b.c.*{1}'
或者,您可以使用:
select path from tree where path ~ 'a.b.c.*{1,}'