country_code
you have four entries laying out all combinations of 2010 and 2015.ON
in your query to include only those records where the p1.year
(2010) matches with p2.year - 5
(2015 - 5 = 2010). This will omit the three entries per country_code
that you aren't interested in.