17,086
社区成员
发帖
与我相关
我的任务
分享
select a.name 台席,b.name 大厅,
count(d.desk_id)台席办理业务次数,
(select count(1) from unicom_login_history where login_time>=to_date('2009-10-15','yyyy-mm-dd')
and logout_time<to_date('2009-10-22','yyyy-mm-dd')) 登录次数,
count(d.desk_id)/(select count(1) from unicom_login_history where login_time>=to_date('2009-10-15','yyyy-mm-dd')
and logout_time<to_date('2009-10-22','yyyy-mm-dd')) 台席利用率
from
unicom_desk a,unicom_hall b,unicom_work d
where a.hall_id=b.id
and a.id=d.desk_id
and d.start_time>=to_date('2009-10-15','yyyy-mm-dd') and d.start_time<to_date('2009-10-22','yyyy-mm-dd')
group by a.name,b.name
select a.name 台席,b.name 大厅,
count(d.desk_id)台席办理业务次数,
(select count(1) from unicom_login_history where trunc(login_time,'iw')=trunc(d.start_time,'iw')) 登录次数,
count(d.desk_id)/(select count(1) from unicom_login_history where trunc(login_time,'iw')=trunc(d.start_time,'iw')) 台席利用率
from
unicom_desk a,unicom_hall b,,unicom_work d
where a.hall_id=b.id
and a.id=d.desk_id
group by a.name,b.name,trunc(d.start_time,'iw')
trunc里的iw改成yyyy是年,改成mm是月