sql计算总数
select
d.store ,count(*),f.created_date,f.plan_state,g.channel_type
from patrol_plan_result d
left JOIN patrol_plan f on d.patrol_plan=f.id
LEFT JOIN basic_crm_channel g on g.CHANNEL_NBR=f.store
where d.created_date>="2015-05-01" and f.exe_start_time>="2015-05-01"
and f.exe_end_time<="2015-05-31" and f.plan_type=1 and g.is_display=0
and g.STATUS_CD=1000 and g.CHANNEL_CLASS=10
group by d.store having count(*) <=30
d.store ,count(*),f.created_date,f.plan_state,g.channel_type
from patrol_plan_result d
left JOIN patrol_plan f on d.patrol_plan=f.id
LEFT JOIN basic_crm_channel g on g.CHANNEL_NBR=f.store
where d.created_date>="2015-05-01" and f.exe_start_time>="2015-05-01"
and f.exe_end_time<="2015-05-31" and f.plan_type=1 and g.is_display=0
and g.STATUS_CD=1000 and g.CHANNEL_CLASS=10
group by d.store having count(*) <=30
声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
- 上一篇:没有了
- 下一篇:没有了
