You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dsMin/BigDataSql/第一页/各阶段学校数量.sql

22 lines
1008 B

SELECT businessType,count(1) as count
from schoolBusinessRelation sbr where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('211') and sbr.isLastYearCancel =0 and sbr.recordyear =2019
group by sbr.businessType
union all
SELECT businessType ,count(*) as c
from schoolBusinessRelation sbr
inner join instanceTable it on sbr.organizationNo =it.organizationNo and sbr.businesstypeno =it.businesstypeno
inner join J412 as j on j.instanceid =it.instanceid and j.did =1
where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('311','312') and sbr.isLastYearCancel =0 and sbr.recordyear =2019 and it.recordyear =2019 and j.recordyear =2019
group by sbr.businessType
union all
SELECT sbr.businessType,count(1) as c
from schoolBusinessRelation sbr where sbr.gatherRegionB ='长春市' and sbr.businessTypeNo in('341','342','345') and sbr.isLastYearCancel =0
GROUP BY sbr.businessType
-- select * from codeschooltype where schooltypeno in ('211','218','312','345','321')