How do I write a query which will return the next date.
Here is example, I want query to populate the Next_Date column
Employee_ID Date Point Next_Date
53 07/31/2015 1 12/02/2015
53 12/02/2015 1 01/12/2016
53 01/12/2016 1 02/10/2016
53 02/10/2016 1
TOP 1 att.attend_date
att.attend_date > att.attend_date
Lead should work, depending on which DB you are using.
select employee_id, date, point, lead(date) over (partition by employee_id order by date) as next_date from your_table