Graph in RDBMS
SELECT e3.*
FROM link AS e3
WHERE
e3.id1 IN (
SELECT e2.id2
FROM link AS e2
WHERE
e2.id1 IN (
SELECT e1.id2
FROM link AS e1
WHERE
e1.id1 = 2006
)
)
Good book (is it good? ;-) ): http://www.elsevier.com/wps/find/bookdescription.cws_home/702605/description#description Articles by the same author: http://www.dbazine.com/ofinterest/oi-articles/celko24 and http://www.dbmsmag.com/9603d06.html Discurrion: http://forum.vingrad.ru/index.php?showtopic=45952 Oracle Tip: Solving directed graph problems with SQL: http://builder.com.com/5100-6388_14-5245017.html Trees in Postgres: http://archives.postgresql.org/pgsql-sql/1999-09/msg00092.php Graphs for pg: http://pgfoundry.org/projects/pggraph/ http://www.cs.cmu.edu/~cache/pg_graph/
|