If you have a large dataset, you may get better performance by simply adding two index columns, one starting at 0 and the other starting at 1, then merge the query with itself joining the second index column to the first. You can then extract the previous row data from the resulting table.