I have a table `employees` as,

```
id   name   startDate   endDate
1    John   2013-8-9    2020-10-30
5    Nick   2011-6-7    2020-10-2
7    Pick   2012-6-9    2019-10-12

```

I have list of employees sorted by start date. Now clicking on a record, I also want to get the next and prev row based on the starting date.
Like in the above example, the array is sorted as 1,7,and 5, so when i click on 7, I also need to get 1 as previous and 5 as next. Please can you help, I got the record by `id`, checked the date greater than `startDate` of that `id` then I ordered by `statDate` in ASC order and limit the record by one.