pgsql 查询子数据
WITH RECURSIVE x AS
( SELECT *
FROM t_org
WHERE orgid = '10001'
UNION ALL
SELECT b.*
FROM x,t_org b
WHERE x.orgid = b.parentorgid
AND b.status = '1'
)
SELECT * FROM x;
编程PDF电子书免费下载: http://www.shitanlife.com/code 每天学习一点点