Mysql 去重取最新的一条数据
SELECT id, job_id, start_time, end_time, cost_time, STATUS, error_message FROM ( SELECT id, job_id, start_time, end_time, cost_time, STATUS, error_message, IF ( @jobid = job_id, @num :=@num + 1, @num := 1 ) AS num, @jobid := job_id FROM pybee_job_detail ORDER BY job_id, end_time DESC ) tab WHERE num = 1;
学如逆水行舟 不进 则退!