题解 | #牛客直播各科目平均观看时长#
牛客直播各科目平均观看时长
https://www.nowcoder.com/practice/e9e7dc4c8623467793f6999cbfee9360
# 字段:course_name、avg_Len # tb1:计算时间差 select course_name, round(avg(timestampdiff(second,in_datetime,out_datetime)/60),2) as avg_Len from attend_tb left join course_tb using(course_id) group by course_name order by round(avg(timestampdiff(second,in_datetime,out_datetime)/60),2) desc