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

query on CSUM - response (3) by Qaisar Aftab Kiani

$
0
0

You need to use window aggregate function, something like this should work...

SEL NAME, MEASURE, DATE,
SUM(MEASURE) OVER(PARTITION BY NAME ORDER BY DATE ASC ROWS UNBOUNDED PRECEDING) AS CUM_AMT
FROM <<TABLE_NAME>>
ORDER BY NAME, DATE ASC;

 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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