Hi All,  

I could use your help in finding an optimal query for the following:

DATA:
BEGIN TRANSACTION;
CREATE TABLE chain(interger a, integer b);
INSERT INTO "chain" VALUES(1,2);
INSERT INTO "chain" VALUES(2,3);
INSERT INTO "chain" VALUES(3,4);
INSERT INTO "chain" VALUES(2,8);
INSERT INTO "chain" VALUES(1,5);
COMMIT;

I know the starting location having b = 4. row 3... 
I would like have ther query return rows  row 2 and row 1. 
Where current.a=prior.b starting with the row b=4.

This is doable in Oracle SQL using start with and connect by prior, What if at 
all possible would be the syntax for sqlite?

Thanks,
Ken





Reply via email to