Re: Pure SQL transitive closure with LEVEL

From: Damjan S. Vujnovic <damjan_at_NOSPAMgaleb.etf.bg.ac.yu>
Date: Tue, 26 Nov 2002 10:59:14 -0800
Message-ID: <arvgjs$ktm$1_at_news.etf.bg.ac.yu>


> I need pure SQL code to compute transitive closure from adjacency
> matrix, say table X(ParentID, ChildID). I managed to compute all
> ancestor/predecessor pairs, but couldn't
> find the way to get a distance (level) between them in same query.
>
> Any ideas?

Hint: CONNECT BY PRIOR

Regards,
Damjan S. Vujnovic

University of Belgrade
School of Electrical Engineering
Department of Computer Engineering & Informatics Belgrade, Yugoslavia

http://galeb.etf.bg.ac.yu/~damjan/ Received on Tue Nov 26 2002 - 19:59:14 CET

Original text of this message