https://forum.phparea.com/thread/how-to-select-previous-column-value-in-mysql