Możesz to zrobić, wyliczając wiersze w ciągu roku. Następnie zaktualizuj wszystkie oprócz pierwszego:
with toupdate as (
select t.*, row_number() over (partition by [year] order by [date]) as seqnum
from t
)
update toupdate
set [year] = NULL
where seqnum > 1;
Jeśli chcesz to jako select
oświadczenie:
with ts as (
select t.*, row_number() over (partition by [year] order by [date]) as seqnum
from t
)
select [date],
(case when seqnum = 1 then [year] end) as [year]
from ts;