题解 | 最受欢迎的top3课程
最受欢迎的top3课程
https://www.nowcoder.com/practice/b9b33659559c46099aa3257da0374a48
select c.cid, count(uid) as pv, sum(timestampdiff(minute,start_time,end_time)) as time_len from course_info_tb as c join play_record_tb as b on c.cid = b.cid where datediff(start_time, release_date) < 7 group by c.cid having avg(score) >=3 order by pv desc limit 3