题解 | 请写出计算粉丝ctr的sql语句

select 
    sum(c.read_num)/sum(c.show_num) as fans_ctr
from
    c
 join b on c.content_id = b.content_id
 join a on c.fans_id = a.fans_id and a.author_id = b.author_id



因为要确定表c中的粉丝是表a作者表中的粉丝,作品是表b中的作品,所以要连接两个表

全部评论

相关推荐

06-04 09:27
门头沟学院 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务