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

Multiple Grand Totals - response (1) by Raja_KT

$
0
0

Hi,

It seems you miss out the BY + fieldname. I am not sure if it allows for multiple with sum too.

I test for onewith sum(xxx) by field1.... it works fine.

However, I test this way using. You can make change accordingly:

SUM(rack_units) OVER (PARTITION BY location ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)

 

select HOSTNAME,LOCATION,RACK_NUMBER,RACK_POSITION,RACK_UNITS,POWER_WATTS,

SUM(rack_units) OVER (PARTITION BY location ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as rkunit,

SUM(VENDOR_MAX_WATT_POWER) OVER (PARTITION BY location ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as tot1,

SUM(rack_units) OVER (PARTITION BY location ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as rk1,

SUM(rack_units) OVER (PARTITION BY location ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING),

SUM(VENDOR_MAX_WATT_POWER) OVER (PARTITION BY location ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as tot2 from TABLE

 

 

Cheers,

 

Raja

 


Viewing all articles
Browse latest Browse all 14773

Trending Articles



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