输入banner图图片脚本导航/分类

postgreSQL ltree工具获取上下级

* from departments

技术分享

/*
  
查询子级部门 path <@ ‘‘ 查询上级部门 path @>
  path: 部门id用‘.‘连接
*/
select
id,name,path,parent_id from departments where path <@ cast(NE*********Pc.NE*********Pd.NE*********Ra as ltree)

技术分享

 

postgreSQL ltree工具获取上下级

标签:pre   postgre   ges   rtm   .com   art   logs   pat   images