Смотреть видео: SQL Server : calculate PnL between Repeating Values of Running Total - Stack Ove