Rekursion In Oracle

Ich habe folgende Tabelle in einer oracle -:

Parent(arg1, arg2)

und ich will die transitive Abschluss der relation Elternteil. Das heißt, ich möchte die folgende Tabelle

Ancestor(arg1, arg2)

Wie geht das in Oracle?

Mache ich die folgenden:

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;

Bekomme ich die Fehlermeldung

*Cause:    column aliasing in WITH clause is not supported yet
*Action:   specify aliasing in defintion subquery and retry
Error at Line: 1 Column: 20

Wie kann ich dies lösen, ohne Spalte aliasing?

InformationsquelleAutor myahya | 2011-01-11
Schreibe einen Kommentar