久未写sql,生疏不少,温习一下。
select nvl(bb.坐席,aa.坐席),bb.呼入量,aa.呼出量 from
(select b.user_name 坐席,count(a.task_id) 呼出量 from cc_core_callout a,tbl_sys_users b where a.creater=b.user_id and a.task_status in('dealing','naturalEnd') and a.create_time like '2010-07-10%' group by b.user_name) aa
full join (select b.user_name 坐席,count(a.task_id) 呼入量 from cc_core_callin a ,tbl_sys_users b where a.creater=b.user_id and a.call_on_time like '2010-07-10%' group by b.user_name) bb
on aa.坐席 =bb.坐席
首先是忘记使用full join了
其次是忘了nvl函数了