Recursive queries

posted on 03:59 PM on Friday 02 August 2013

I have always been amazed by Oracle's connect by query construct which enables recursive queries. I use quite a bit of graphs in my work and representing and using them with a database has been less than ideal. I just realized that PostgreSQL and SQL Server are also able to do this using Common Table Expression (CTE). This is really useful stuff. Link to PostgreSQL and SQL Server documentation as follows:

http://msdn.microsoft.com/en-us/library/ms186243%28v=sql.105%29.aspx

http://www.postgresql.org/docs/8.4/static/queries-with.html

bernett.net