mysql查询ID相同的某字段最大那条记录
SELECT o.main_line_require_id, o.order_create_tm, m.effective_tm, m.line_require_type, m.edit_type, m.require_category, o.line_code, o.cvy_name, o.src_zone_code, o.dest_zone_code, o.line_require_id, o.order_status, o.delay_time FROM tt_rs_order_detail_monitor o, tt_rs_main_line_base_info m WHERE o.main_line_require_id = m.main_line_id AND m.version = ( SELECT max(t.version) FROM tt_rs_main_line_base_info t WHERE t.main_line_id = o.main_line_require_id );