3,491
社区成员
发帖
与我相关
我的任务
分享
select jysj,jgh,count(*) jyje from cxjy_ls
where jgh in
(select newjgh from xt_jghdzb
where connect_by_isleaf=1 and newjgh in (select jgh from xt_gyb)
START WITH newjgh='53000000' CONNECT BY PRIOR newjgh=sjjgh)
and jysj>='2017-01-05 00:00:00' and jysj<='2017-02-10 23:59:59'
and jydm in('000001','000001','000006','000002','000001') and jymc is not null
group by jysj,jgh ;
select substr(jysj,1,10),jgh,count(skh) skh,count(jyje) jyje from cxjy_ls
where jgh in
(select newjgh from xt_jghdzb
where connect_by_isleaf=1 and newjgh in (select jgh from xt_gyb)
START WITH newjgh='53000000' CONNECT BY PRIOR newjgh=sjjgh)
and jysj>='2017-01-05 00:00:00' and jysj<='2017-02-10 23:59:59'
and jydm in('000001','000001','000006','000002','000001') and jymc is not null
group by substr(jysj,1,10),jgh ;
select to_char(jysj,'yyyy-mm-dd'),
count(case when jgh='43004894' then jyje end) "43004894" ,
count(case when jgh='43004994' then jyje end) "43004994" ,
count(case when jgh='43005003' then jyje end) "43005003" ,
from cxjy_ls
where jgh in
(select newjgh from xt_jghdzb
where connect_by_isleaf=1 and newjgh in (select jgh from xt_gyb)
START WITH newjgh='53000000' CONNECT BY PRIOR newjgh=sjjgh)
and jysj>='2017-01-05 00:00:00' and jysj<='2017-02-10 23:59:59'
and jydm in('000001','000001','000006','000002','000001') and jymc is not null
group by to_char(jysj,'yyyy-mm-dd');
select substr(jysj,1,10),jgh,jz,count(skh) skh,count(jyje) jyje from cxjy_ls a,xt_gyb b
where a.JGH=b.JGH
and a.jgh in
(select newjgh from xt_jghdzb
where connect_by_isleaf=1 and newjgh in (select jgh from xt_gyb)
START WITH newjgh='53000000' CONNECT BY PRIOR newjgh=sjjgh)
and jysj>='2017-01-05 00:00:00' and jysj<='2017-02-10 23:59:59'
and jydm in('000001','000001','000006','000002','000001') and jymc is not null
group by substr(jysj,1,10),jgh ,jz;
按你描述的是这样,不过具体数据要具体分析的