SELECT uid, nick_name, achievement FROM user_info WHERE uid IN ( SELECT uid FROM exam_record LEFT JOIN practice_record pr USING(uid) LEFT JOIN user_info USING(uid) WHERE nick_name LIKE '牛客%号' AND achievement BETWEEN 1200 AND 2500 GROUP BY uid HAVING MAX(...