How to avoid inner query im MYSQL I have a table with 4.7 million rows and I am executing this query on this table:

SELECT * FROM students WHERE `eid` IN 
(SELECT DISTINCT `eid` FROM students WHERE code IN ('120', '330'));


This is working fine but it slows down the performance. How can I boost up performance by changing this query or how can I do the same work with some other optimized query (in better way)?
Having no idea of your table... The first thing to try would be to

CREATE INDEX i_code ON students (code);
CREATE INDEX i_eid ON students (eid);