My query resembles this
select distinct b.year, (case when b.year = 2020 then 0 else beginning.amt end) Beginning , (case when b.year >= 2020 th