I have the following table in an oracle:
Parent(arg1, arg2)
and I want the transitive closure of the relation parent. That is, I want the following table
Ancestor(arg1, arg2)
How is this possible in Oracle?
I am doing the following:
WITH Ancestor(arg1, arg2) AS (
SELECT p.arg1, p.arg2 from parent p
UNION
SELECT p.arg1 , a.arg2 from parent p, Ancestor a
WHERE p.arg2 = a.arg1
)
SELECT DISTINCT * FROM Ancestor;
I get the error
*Cause: column aliasing in WITH clause is not supported yet
*Action: specify aliasing in defintion subquery and retry
Error at Line: 1 Column: 20
How can I solve this without column aliasing?