Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2021 01:12 PM
Consider the following input:
ID PrevID
-------- ---------
33 NULL
272 33
317 272
318 317I need to somehow get the following result:
Result
--------
/33
/33/272
/33/272/317
/33/272/317/318I need to do this in SQL and if REALLY not possible, then anything else goes, and Databricks does not support recursive CTE's so I am out of ideas, i have an SQL Fiddle here that illustrates the recursivce CTE way that doesn't work on databricks: http://sqlfiddle.com/#!18/101df/3/0
Any help is appreciated, thanks
Labels:
- Labels:
-
Databricks SQL
-
Input
-
Result
-
SQL