How can we change below CTE query (recursive) to simple subset sql:
WITH links (parent, child) AS
( SELECT parent, child
FROM Heirarchy_Table
WHERE parent = '111111'
UNION ALL
SELECT ht.parent, ht.child
FROM Heirarchy_Table ht
INNER JOIN links ON links.child = ht.parent)
SELECT * FROM links fl;
I need to use this query for JPA as JPA is not handling "WITH" clause. [Note: "links" cte is used recursively]. Many Thanks!!