I have a table like this:
| MRLNum | CreatedOn | ReviseCode | RequiredQty |
|---|---|---|---|
| SAN-000027-001 | 2/28/2023 | 0 | 100 |
| SAN-000027-001 | 2/28/2023 | 1 | 30 |
This will list values by rowInt. How can get get the difference of Value between two rows with the result like this:
| MRLNum | CreatedOn | ReviseCode | RequiredQty | ReviseCodePrvDiff | RequiredQtyPrvDiff |
|---|---|---|---|---|---|
| SAN-000027-001 | 2/28/2023 | 0 | 100 | NA | NA |
| SAN-000027-001 | 2/28/2023 | 1 | 30 | 0 | 100 |
The table is in SQL 2017 (Miscrosoft)