Tag: loops

Calculate new rows (or columns) based previously calculated rows (or columns) in same select statement

I am trying to calculate the yearly expected sales volumes based on yearly sales growth expectations. In one table I have the actual sales volume: create table #Sales ( ProductId int, Year int, GrowthRate float ) insert into #Sales values (1, 2021, 1000), (2, 2021, 5000) and in another table I have the yearly growth […]

Back To Top