题解 | #牛客直播各科目平均观看时长#
牛客直播各科目平均观看时长
http://www.nowcoder.com/practice/e9e7dc4c8623467793f6999cbfee9360
select course_name,
round(avg(TIMESTAMPDIFF(minute,in_datetime,out_datetime)),2) as avg_len
from course_tb right join attend_tb using(course_id)
GROUP BY course_name
order by avg_len DESC