【大厂真题】SQL26题解 | 请写出计算粉丝ctr的sql语句

# 通过


SELECT SUM(read_num)/SUM(show_num) as fans_ctr
from c
inner join 
(
    SELECT b.content_id as content_id1,a.fans_id as fans_id1
    FROM  b
    LEFT JOIN 
      a  # 多了from
    on b.author_id=a.author_id
) t 
on c.content_id=t.content_id1
and c.fans_id=t.fans_id1

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务