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

Need Help to implement recursive logic - forum topic by sudha123

$
0
0

I have  tow  tables  say A  and B which is  having  date  field  and  amount  field  respectively. Have  to  check  whether a.date > b.date  if  yes  then  check  a.amount > b.amount  if  yes  then   do  a.amt - b.amt  until  we  get  a.amount < b.amount (basically create  mutliple  rows)
ex: a. amount ---2000
b.amount is  200
1st row   -----2000
2nd row-----2000-200=1800
3rd  row--1600
....10th  row --0

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles