Window Function in Sql.
1.Aggregate : Sum,Max,min,Avg,...
2.Ranking Function - Row_number,Rank,Dense_Rank,ntile
3.Analytic Function - Lead ,Lag
Over (
Partition by
Order by
)
Create database Demo_July052024
use Demo_July052024
go
Select 1 Id ,100 Amount,1 GroupId into Demo_data union
Select 2,200,1 union
Select 3,300,1 union
Select 4,200,2 union
Select 5,200,2 union
Select 6,300,2 union
Select 7,400,3 union
Select 8,200,3 union
Select 9,300,3
4 окт 2024