SELECT * FROM(SELECT MAX(id) AS id FROM icbc_erp_kj_icbc_result WHERE STATUS = 61 GROUP BY qryid) aINNER JOIN icbc_erp_kj_icbc_result b on b.id =a.id