with t1 as(select user_id, visit_time, truncate ( timestampdiff(second, visit_time, leave_time) / 60 / 10,0 ) vp from visit_tb) select user_id,sum(vp) point from t1 group by user_id order by point desc
with t1 as(select user_id, visit_time, truncate ( timestampdiff(second, visit_time, leave_time) / 60 / 10,0 ) vp from visit_tb) select user_id,sum(vp) point from t1 group by user_id order by point desc