WITH cte_child (id, title, parent, level)
AS (
SELECT id,
title,
parent,
0 AS level
FROM tb_menu
WHERE id = 6
UNION ALL
SELECT a.id,
a.title,
a.parent,
b.level + 1
FROM tb_menu a
INNER JOIN cte_child b
ON (a.parent = b.id)
)
SELECT *
FROM cte_child;