, , select: MAX (LEAD), .
select
id, yr, dt
,MAX(nx_dt) OVER (PARTITION BY id, dt) nxt_dt
FROM
(
select
*
, LEAD(dt) OVER (PARTITION BY id, yr ORDER BY id, yr, dt) nx_dt
from
) sub
/*
drop table
create table
(
id int, yr int, dt date
)
insert into
(
id, yr, dt
)
SELECT 1111,2016,'2016-02-28' union all
SELECT 1111,2016,'2016-02-28' union all
SELECT 1111,2016,'2016-03-31' union all
SELECT 1111,2016,'2016-03-31' union all
SELECT 1111,2016,'2016-03-31' union all
SELECT 1111,2016,'2016-04-02' union all
SELECT 1111,2016,'2016-05-31' union all
SELECT 1111,2016,'2016-08-01' union all
SELECT 1111,2016,'2016-12-11' union all
SELECT 1111,2017,'2017-01-02' union all
SELECT 1111,2017,'2017-01-02' union all
SELECT 1111,2017,'2017-02-04' union all
SELECT 1111,2017,'2017-02-04' union all
SELECT 1111,2017,'2017-07-08' union all
SELECT 2222,2016,'2016-02-11' union all
SELECT 2222,2016,'2016-02-11' union all
SELECT 2222,2016,'2016-03-28' union all
SELECT 2222,2016,'2016-03-28' union all
SELECT 2222,2016,'2016-03-28' union all
SELECT 2222,2016,'2016-07-22' union all
SELECT 2222,2016,'2016-12-31' union all
SELECT 2222,2017,'2017-02-01' union all
SELECT 2222,2017,'2017-02-14'
*/