MySQL query for 3 consecutive integers between records
SELECT DISTINCT
t.id
FROM tablename t
WHERE EXISTS (
    SELECT 1 FROM tablename x
    WHERE x.id = t.id
    AND x.year = t.year+1
)
AND EXISTS (
    SELECT 1 FROM tablename x
    WHERE x.id = t.id
    AND x.year = t.year-1
)