yh19931023评论 阳光走了猫不来 :参考吧:WITH s1 as (
select sum(经销商) as 登录数
from B
where date = \'时间参数\'
GROUP BY 经销商
),
s2 as (
SELECT sum(个数) as 注册则总人数
from A
where date <= \'时间参数\'
)
select s1.登录数/s2.注册则总人数 as 登陆率
from s1,s2
阳光走了猫不来(提问者)mysql 用不了你那个 我自己写了个 报错
SELECT a.*,b.* from
(
SELECT sum(num) as gs ,date_format(data_date,\"%Y-%m-%d\") as day,position_name FROM clm_t_user_day_ft a
where position_name in(\"销售顾问\",\"网销顾问\",\"关键客户经理\",\"关键客户顾问\")
group by position_name,day
)a
FULL JOIN(
select count(*) as zcs,date_format(lin_time,\"%Y-%m-%d\") as zcday,position_name as name from clm_t_user_detail_mes
where position_name in(\"销售顾问\",\"网销顾问\",\"关键客户经理\",\"关键客户顾问\")
and is_onjob=1
group by name,zcday)b
ON a.position_name=b.name