在执行一个sql中存在递归语法的语句时,报错了,是不支持这种递归操作嘛,sql语句如下:
LEFT JOIN t_user tdu ON tdu.department_id IN
WITH RECURSIVE nested_departments AS (
SELECT td.department_id, td.parent_department_id
FROM t_department td
WHERE td.department_id = tdr.access_object_id
UNION ALL
SELECT d.department_id, d.parent_department_id
FROM t_department d
JOIN nested_departments nd ON d.parent_department_id = nd.department_id)
SELECT e.department_id
FROM t_department e
JOIN nested_departments nd ON e.department_id = nd.department_id)
AND tdr.access_object_type = 1