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以来,该功能几乎已过时
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)