Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

How to sum up the columns total value in the last row - response (5) by dnoeth

$
0
0

For BTEQ don't use the column alias but the original name, i told you i didn't use it for years :-)
WITH sum ( INC_AMT )  , count (*)
 
And for GROUPING SETS you get rid of the NULLs using GROUPING and CASE (but then you can't use the ordinal position within GROUP BY, must use the column name instead) like
case when grouping(LOB) = 1 then 'TOTALS' else LOB end  
 
 
Dieter


Viewing all articles
Browse latest Browse all 27759

Trending Articles



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