题解 | #每类视频近一个月的转发量/率#

每类视频近一个月的转发量/率

https://www.nowcoder.com/practice/a78cf92c11e0421abf93762d25c3bfad

 select tag,sum(if_retweet) retweet_cut,round(sum(if_retweet)/count(*),3) retweet_rate from(
 select a.*,b.tag from tb_user_video_log a 
  left join
  tb_video_info b
  using(video_id)
  where timestampdiff(day,date_format(start_time,'%Y-%m-%d'),'2021-10-01')<30 and uid is not null
  ) c
  group by tag
  order by retweet_rate desc

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务