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
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
Post a Comment