在PostrgreSQL中是否有等效的connectby通过树向上移动?

在PostrgreSQL中是否有等效的connectby通过树向上移动?,第1张

在PostrgreSQL中是否有等效的connectby通过树向上移动?

通常使用递归公用表表达式来完成此 *** 作。

with recursive cte as (  select descriptor_value_id, parent_value_id, 1 as level  from descriptor_value  where descriptor_value_id = 87  union all  select p.descriptor_value_id, p.parent_value_id, c.level + 1  from descriptor_value p     join cte c on c.parent_value_id = p.descriptor_value_id)select * from cte;

connectby()
自Postgres 8.4中引入递归CTE以来,该功能几乎已过时



欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/4911847.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-12
下一篇 2022-11-12

发表评论

登录后才能评论

评论列表(0条)

保存