您的位置:首页 > 数据库 > Oracle

oracle 按照周 分组

2013-10-23 15:04 211 查看
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
 
本文出自 “小浩” 博客,请务必保留此出处http://zhangchi.blog.51cto.com/5214280/1251152
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: