Groups > Interbase > Interbase General discussion > Interbase support for recursive SQL queries




Re: Interbase support for recursive SQL queries

Re: Interbase support for recursive SQL queries
13 Apr 2008 07:21:13 -0700
Enquiring Mind wrote:

> Does Interbase support recursive SQL queries (e.g. ISO recursive
> WITH), and if so, from which Version?

No, it does not.

-- 
Post Reply
Interbase support for recursive SQL queries
Sun, 13 Apr 2008 10:25:10 +010
Hi,

Does Interbase support recursive SQL queries (e.g. ISO recursive WITH), and 
if so, from which Version?

Suppose I have a table Items that has ID and ParentID fields. What SQL 
statement would extract the record R0 such that R0.ID= :ID, the record R1 
such that  R1.ID= R0.ParentID, and so on up to record RN such that RN.ID= 
RN-1.ParentID and RN.ParentID is null?

I know that stored procedures can be used to extract this recursive query, 
but I would prefer to use a SQL statement.

Thanks in advance.

EM
 

Post Reply
about | contact