select to_char(p.create_date,'WW') as dat,
count(1) as cnt
from crm_percustomer p
--用拥有者关联员工
left join tbl_employee em on em.uuid=p.owner
--用员工关联部门,查城市
left join tbl_dep dep on dep.uuid=em.dep_uuid
where
p.create_date >= to_date('2013-01-01','yyyy-mm-dd') and p.create_date <= to_date('2013-12-30','yyyy-mm-dd')
and dep.vcity='北京市'
group by to_char(p.create_date,'WW')
order by dat asc