Monday, March 26, 2012

Info Recursive Queries

Hello all,

for computig graphs and its transitive closure I need recursive SQL-Queries. Best it will be fast.

Now I heard of a new syntax in SQL: the WITH RECURSIVE-Clause.

Which Database-Editions and versions support those recursive queries?

Can anyone tell me where can I find more info about it?

Thanks and best regards

yelmin

It is implemented in SQL Server 2005 with the new CTE ( common table expression ) the base requirements your tables must be UNION compatible by default or through conversion because the sections are connected by UNION ALL. It is very complex if you need to go many levels deep you may want to check out Joe Celko's Trees book. Hope this helps.

Microsoft docs to get you started.

http://msdn2.microsoft.com/en-us/library/ms186243.aspx

http://msdn2.microsoft.com/en-us/library/ms175972.aspx

The book to browse at your local book store.

http://www.amazon.com/Hierarchies-Smarties-Kaufmann-Management-Systems/dp/1558609202

No comments:

Post a Comment