-- limity dla 26 lat

-- SELECT SUM(KwotaDoLimitu26Narast) AS KwotaDoLimitu26Narast FROM ( 
SELECT IFNULL(SUM(KwotaDoLimitu26),0) AS KwotaDoLimitu26Narast 
FROM prace_zlecone WHERE GUID_Pracownika = '{7F9DD9A0-7A97-42E4-A945-0B44F8B8E6EC}' AND  YEAR(datawyplaty) = 2022 
AND MONTH(datawyplaty) < 2
AND GUID <> '' AND deleted = 0 ;

SELECT GUID, miesiac, IFNULL((KwotaDoLimitu26),0) AS KwotaDoLimitu26Narast 
FROM place WHERE GUID_pracownika = '{7F9DD9A0-7A97-42E4-A945-0B44F8B8E6EC}' AND YEAR(datawyplaty) = 2022 AND GUID <> '' AND deleted = 0 ;
--         )) newTable; 