How the unbounded following works in SQL server 2012? -


the table "cric_team" looks this

when execute below query in sql server 2012, 'unbounded following' not calculating sum upto last row of partition. but, per definition, should calculate upto last row current row.

select cric_id,cric_first_name,cric_last_name,cric_role ,runs,centuries ,fifty fifties,ducks,sum(ducks) on ( partition cric_role order ducks range between current row , unbounded following ) total_ducks cric_team

the screenshot of table after executing query

how using descending sort instead? want?

select cric_id, cric_first_name, cric_last_name, cric_role, runs,        centuries, fifty fifties, ducks,        sum(ducks) on ( partition cric_role order ducks desc) total_ducks   cric_team; 

Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -