方法一:

SELECT * from (

SELECT * from oct_hr_user_clock  ORDER BY clock_time desc limit 10000

) v GROUP BY v.user_id 

注意:limit必须要加

方法二:

SELECT * from oct_hr_user_clock a 

join 

(

SELECT max(clock_time) as clock_time,user_id from oct_hr_user_clock GROUP BY user_id

) b

on a.user_id=b.user_id

and a.clock_time=b.clock_time