Read it as: "keep the trainers whose trainer_id appears in that list". The list contains 1 three times and 2 five times, but that changes nothing: IN only checks whether a value is present, so each trainer comes out once. Unlike a scalar subquery, this one may return many rows — but always one column.