Archive

Archive for June, 2011

Recursion in SQL

We are used to easily writing recursive calls and loops in procedural languages, but this doesn’t hold true in SQL. Indeed, it depends on the DBMS used.

This article will focus on the ability to write recursive queries using Common Table Expressions (CTE). CTE are an addition from the SQL 1999 standard and are not yet available in all DBMS. As of today, CTE are at least compatible with:

  • Microsoft SQL Server 2000 / 2005 / 2008
  • IBM DB2
  • Oracle 9.2
  • PostgreSQL

Read more…

Categories: HowTo Tags: , , , , , ,
Follow

Get every new post delivered to your Inbox.