Subject Re: [firebird-support] WITH RECURSIVE or not WITH RECURSIVE
Author Gabor Boros
2018. 05. 29. 19:08 keltezéssel, Omacht András aomacht@...
[firebird-support] írta:
> Hi Gabor!
>
> You can do it with recursive cte:


First of all, thank you very much! But...

I got "multiple rows in singleton select multiple rows in singleton
select" (yes, double) error message with my real data. It's easy to
reproduce just execute the next script for additional test data.

INSERT INTO TABLE1 (ID, PARENT_ID) VALUES (7, NULL);
INSERT INTO TABLE1 (ID, PARENT_ID) VALUES (8, 7);
INSERT INTO TABLE1 (ID, PARENT_ID) VALUES (9, 8);
INSERT INTO TABLE1 (ID, PARENT_ID) VALUES (10, 7);
INSERT INTO TABLE1 (ID, PARENT_ID) VALUES (11, 10);
INSERT INTO TABLE1 (ID, PARENT_ID) VALUES (12, 7);

Gabor