由于水平原因,博客大部分内容摘抄于网络,如有错误或者侵权请指出,本人将尽快修改

连接

select Employee.Name as Name
from (
  select ManagerId as Id
  from Employee
  group by ManagerId
  having count(Id) >= 5
) as Manager join Employee
on Manager.Id = Employee.Id
select a.user_id,
round(sum(if (b.action='confirmed',1.00,0.00)) / count(a.user_id), 2) as confirmation_rate 
from Signups a left join Confirmations b on a.user_id = b. user_id
group by a.user_id

 

posted @ 2024-07-03 23:36  小纸条  阅读(20)  评论(0)    收藏  举报