select round(sum(score)/count(distinct user_id),3) as avg_score from user_action_tb where user_id in (select user_id from user_action_tb as tb1 join recommend_tb as tb2 on tb1.user_id = tb2.rec_user and tb1.hobby_l = tb2.rec_info_l )
用连接和子查询
select round(sum(score)/count(distinct user_id),3) as avg_score from user_action_tb where user_id in (select user_id from user_action_tb as tb1 join recommend_tb as tb2 on tb1.user_id = tb2.rec_user and tb1.hobby_l = tb2.rec_info_l )
用连接和子查询