Use page_id when parent_id is not set (no children yet)

This commit is contained in:
Jan Kvetina 2022-01-06 23:07:13 +01:00
parent 3effb49291
commit 6ced423a30

View File

@ -16,7 +16,7 @@ SELECT
p.page_id,
--
(
SELECT MIN(g.parent_id)
SELECT NVL(MIN(g.parent_id), MIN(g.page_id)) AS parent_id
FROM g
WHERE g.page_group = p.page_group
) AS parent_id,