I have this table:
Date | Product | Sales |
---|---|---|
1/3/2021 | Apple | 10 |
1/3/2021 | Lemon | 20 |
1/3/2021 | Mango | 30 |
1/4/2021 | Apple | 15 |
1/4/2021 | Lemon | 25 |
1/5/2021 | Apple | 20 |
1/5/2021 | Lemon | 20 |
1/5/2021 | Mango | 35 |
And I want to add a new column like this:
Date | Product | Sales | Prev Day Sales |
---|---|---|---|
1/3/2021 | Apple | 10 | null |
1/3/2021 | Lemon | 20 | null |
1/3/2021 | Mango | 30 | null |
1/4/2021 | Apple | 15 | 10 |
1/4/2021 | Lemon | 25 | 20 |
1/5/2021 | Apple | 20 | 15 |
1/5/2021 | Lemon | 20 | 25 |
1/5/2021 | Mango | 35 | null |