Hola Miquel,
y gracias por tu contribución,
> You are not using a recursive function because it is needed to call the table "rcte" in the UNION ALL
> But it will fail because t3.parent is null at the beginning, so try this another one
> WITH rcte (child, parent) AS
> (
> SELECT parent AS child, '' AS parent FROM tree t1
> WHERE Parent NOT IN (SELECT child FROM tree)
> UNION ALL
> SELECT t2.child, t3.parent FROM tree t2
> JOIN rcte t3 ON t2.parent >= t3.parent
> )
> I haven't tried.
That's great - I've played around with it a wee bit - still have a lot
to learn! :-)
Haven't had too much time - but I think it's slowly dawning on me.
Best regards,
Pól...