У вас есть CTE, который получает детей. Почему бы не использовать другой для go в противоположном направлении и получить родителей:
MySQL:
(WITH RECURSIVE cte (id, name, parent_id) AS (
SELECT id, name, parent_id
FROM organization
WHERE id = 1
UNION
SELECT t1.id, t1.name, t1.parent_id
FROM organization t1
INNER JOIN cte t2 ON t1.parent_id = t2.id
)
SELECT * FROM cte)
UNION
(WITH RECURSIVE cte (id, name, parent_id) AS (
SELECT id, name, parent_id
FROM organization
WHERE id = 1
UNION
SELECT t1.id, t1.name, t1.parent_id
FROM organization t1
INNER JOIN cte t2 ON t2.parent_id = t1.id
)
SELECT * FROM cte)
И версия, которая работает как в MySQL и MariaDB:
MySQL / MariaDB:
WITH RECURSIVE cte (id, name, parent_id, dir) AS (
SELECT id, name, parent_id, cast(null as char(10)) as dir
FROM organization
WHERE id = 1
UNION
SELECT t1.id, t1.name, t1.parent_id, ifnull(t2.dir, 'down')
FROM organization t1
INNER JOIN cte t2 ON t1.parent_id = t2.id and ifnull(t2.dir, 'down')='down'
UNION
SELECT t1.id, t1.name, t1.parent_id, ifnull(t2.dir, 'up')
FROM organization t1
INNER JOIN cte t2 ON t2.parent_id = t1.id and ifnull(t2.dir, 'up')='up'
)
SELECT id, name, parent_id FROM cte;
См. db-fiddle и dbfiddle