欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

LeetCode-SQL-597. 好友申请 I :总体通过率

程序员文章站 2022-06-11 14:28:40
...

LeetCode-SQL-597. 好友申请 I :总体通过率

LeetCode-SQL-597. 好友申请 I :总体通过率

LeetCode-SQL-597. 好友申请 I :总体通过率

select
round(
    ifnull(
    (select count(*) from (select distinct requester_id, accepter_id from request_accepted) as A)
    /
    (select count(*) from (select distinct sender_id, send_to_id from friend_request) as B),
    0)
, 2) as accept_rate;

 

相关标签: LeetCode 数据库