Subject | Re: [firebird-support] WITH RECURSIVE or not WITH RECURSIVE |
---|---|
Author | Gabor Boros |
Post date | 2018-05-30T12:41:30Z |
2018. 05. 29. 19:08 keltezéssel, Omacht András aomacht@...
[firebird-support] írta:
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
[firebird-support] írta:
> Hi Gabor!First of all, thank you very much! But...
>
> You can do it with recursive cte:
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