运维网's Archiver
论坛
›
PostgreSQL
› postgresql递归查询
reko_3
发表于 2016-11-19 10:07:29
postgresql递归查询
WITH RECURSIVE r AS (
SELECT * FROM system_module WHERE module_id = ?
union ALL
SELECT system_module.* FROM system_module, r WHERE system_module.parent_module_id = r.module_id
) SELECT r.module_id FROM r ORDER BY module_id
页:
[1]
查看完整版本:
postgresql递归查询