You can use Lead Analytical function to get Previous or next row.