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
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