Tag: funkcje okna

Development, SQL Server

Zaawansowane przesuwanie okien :D (czyli użycie funkcji „okienkowych” OVER i zastosowanie ROWS,RANGE,BETWEEN,UNBOUNDED, CURRENT, PRECEDING, FOLLOWING)

Z dokumentacji technet: https://msdn.microsoft.com/pl-pl/library/ms189461%28v=sql.110%29.aspx ROWS | RANGE Further limits the rows within the partition by specifying start and end points within the partition. This is done by specifying a range of rows with respect to the current row either by logical association or physical association. Physical association is achieved byCzytaj dalej / Read more

Development, SQL Server

Potęga funkcji okna – SELECT LAG(), LEAD(), FIRST_VALUE(), LAST_VALUE()

Z dokumentacji technet: https://msdn.microsoft.com/en-us/library/hh231256.aspx https://msdn.microsoft.com/en-us/library/hh213125.aspx https://msdn.microsoft.com/en-us/library/hh213018.aspx https://msdn.microsoft.com/en-us/library/hh231517.aspx LAG provides access to a row at a given physical offset that comes before the current row. LEAD provides access to a row at a given physical offset that follows the current row. FIRST_VALUE returns the first value in an ordered set ofCzytaj dalej / Read more