DROP TABLE IF EXISTS my_table;
CREATE TABLE my_table
(id INT NOT NULL
,year INT NOT NULL
,PRIMARY KEY(id,year)
);
INSERT INTO my_table VALUES
(40,'2017'),
(45,'2017'),
(50,'2017'),
(50,'2018'),
(52,'2017'),
(52,'2018'),
(53,'2017'),
(53,'2018');
SELECT DISTINCT x.*
FROM my_table x
JOIN my_table y
ON y.id = x.id
AND y.year <> x.year;
WHERE y.id IS NULL;
+----+------+
| id | year |
+----+------+
| 50 | 2017 |
| 50 | 2018 |
| 52 | 2017 |
| 52 | 2018 |
| 53 | 2017 |
| 53 | 2018 |
+----+------+