Your question is a bit unlikely, but you say you want a list of Entity-object with the attribute Year being unique. This will result ni only two object in the list, one having year being 2018, one having year being 2019. Easiest way to get that is this OQL
FROM YourModule.Entity e GROUP BY e.Year SELECT e.Year
If you want any value for Date and Month, you will have to add them behind SELECT e.Year and you need them to be grouped or summed or ‘take first’.