我有一个带有列的树结构表:id,parent,name.给定树A-> B-> C,如何根据C的ID获得最顶层的父A的ID?特别是如何用"with recursive"编写SQL?谢谢!
postgresql
postgresql ×1