signed

QiShunwang

“诚信为本、客户至上”

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

2021/6/9 5:39:30   来源:

select round(
    ifnull(
        (select count(distinct requester_id, accepter_id) from RequestAccepted) 
        /
        (select count(distinct sender_id, send_to_id) from FriendRequest) , 0),2) as accept_rate;

select round(

    ifnull(

        (select count(distinct requester_id, accepter_id) from RequestAccepted) 

        /

        (select count(distinct sender_id, send_to_id) from FriendRequest) , 0),2) as accept_rate;