0

Oracle:

select sum(age) over (partition by snumber order by grades rows between unbounded preceding and 0 preceding) 
from temp_table

Can somebody provide me the equivalent code for this in the SQL server? I tried

select sum(age) over (partition by snumber order by grades) 
from temp_table

and got syntax error

Incorrect syntax near 'order'

Can't we use order by in the partition by when using a sum function?

Please suggest !

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
G4Gaurab
  • 87
  • 7

0 Answers0