Adhoc SQL Request

Database
KVB
N/A

Adhoc SQL Request

Hi

I have a scenario like the below.

CREATE TABLE DT(PATH VARCHAR(20));

INSERT INTO DT VALUES('A');

INSERT INTO DT VALUES('A--->B');

INSERT INTO DT VALUES('A--->B--->C');

INSERT INTO DT VALUES('A--->B--->C--->D');

INSERT INTO DT VALUES('A--->B--->C--->D--->E');

INSERT INTO DT VALUES('A--->B--->C--->D--->F');

I have the path like the above.Instead of maintaing the reduandant path,It's enough to get the maximum path traversed.

My output needs to be

A--->B--->C--->D--->E

A--->B--->C--->D--->F

Regards

KVB