Subject Re: [firebird-support] CTE recursive WITH error
Author Jiri Cincura
On 5/1/08, giuliano@... <giuliano@...> wrote:
> WITH ric(id,father,description,depth,level)

WITH RECURSIVE


For example:
WITH recursive ric(id,father,depth)
AS
(
select id,
father,
cast('' as varchar(255)) as depth
from TREE
where tree.id=1

union all

select tree.id,
tree.father,
depth || '_' as depth
from TREE inner join ric
ON tree.father = ric.id
)
SELECT * from ric

--
Jiri {x2} Cincura (CTO x2develop.com)
http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com