题解 | 统计用户获得积分
SELECT user_id, SUM(FLOOR(TIME_TO_SEC(TIMEDIFF(leave_time,visit_time))/600)) point FROM visit_tb GROUP BY user_id ORDER BY point DESC
SELECT user_id, SUM(FLOOR(TIME_TO_SEC(TIMEDIFF(leave_time,visit_time))/600)) point FROM visit_tb GROUP BY user_id ORDER BY point DESC
相关推荐