Modify this to be dynamic, for all years, in mysql SELECT
id_korisnika,
    id_dzemata,
    MAX(CASE WHEN godina = '2023' THEN placena ELSE NULL END) AS '2023',
    MAX(CASE WHEN godina = '2022' THEN placena ELSE NULL END) AS '2022'
FROM 0Xvr1Ea_jet_cct_NAME_1
GROUP BY id_dzemata