MySQL has a bunch of functions that enable us to get values from another row in the same column. This makes it easy for us to do stuff like calculate the difference between a value in the current row and one in another row, even if it’s in the same column.
Here are five options for calculating the difference between a value in the current row and a value in a different row but in the same column.
Continue reading