There is only one table, self-association, compare scores, take the top two
SELECT * FROM stuscore A WHERE (SELECT COUNT(DISTINCT score) FROM stuscore B WHERE A.subject = B.subject AND B.score>=A.score)<=2 ORDER BY A.score DESC;
If there are two second places with the same score, both will be displayed