Shortening Oracle SQL containing several unions
Found a possibility employing UNPIVOT
WITH
x(id, yr, more_info) AS
    (SELECT 1, 2020, 'info1' FROM DUAL UNION 
     SELECT 2, 2021, 'info2' FROM DUAL UNION 
     SELECT 3, 2021, 'info3' FROM DUAL UNION 
     SELECT 4, 2020, 'info4' FROM DUAL )
,
n(n_id, n_id2, n_year) AS
    (SELECT 1, 3, 2021 FROM DUAL UNION 
     SELECT 2, 4, 2021 FROM DUAL )
     
SELECT * FROM x
UNION
SELECT id2, n_year, more_info 
FROM (SELECT * 
      FROM x
      WHERE (id, yr) IN (SELECT id, MAX(yr)
                         FROM x
                         GROUP BY id) ) t1,
     (SELECT * FROM n
      UNPIVOT(
          id2
          FOR id_type
          IN (n_id, n_id2) ) ) t2
WHERE t1.id = t2.id2