Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Adhoc SQL Request - forum topic by bikky6

$
0
0

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

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>