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

Recursive Query - response (2) by Sarah_07

$
0
0

Hi Khurram,
My scenario is

CASE WHEN  ( B.REC1 IS NULL OR B.REC1 =0)
THEN LATST_DND --this was derived from other case stmt
else B.REC1 END AS LATESTDND 

my sample data would like below
B.REC1 A.DND_NO
2239    104
4015    2239
0          4015
Now, for the record A.DND_NO ='104' my LATESTDND should be 4015. But as per my query the output stops at 2239 which is not the expected result. Am not able to figure out how to do it with recursive query. Kindly help me.
 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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