我在sql中执行了union,它使用同一个表进行组合。
select 'High school education < College education' as 'Qualification criteria', sum(distinct a.cases) as 'Total cases'
from mydb.covid_19_info a inner join mydb.social_health_info b on a.fips = b.fips
where high_school_graduation_rate < percent_some_college
union
select 'High school education > College education' as 'Qualification criteria', sum(distinct a.cases) as 'Total cases'
from mydb.covid_19_info a inner join mydb.social_health_info b on a.fips = b.fips
where high_school_graduation_rate > percent_some_college;
我希望使用聚合获得相同的mongodb查询。
暂无答案!
目前还没有任何答案,快来回答吧!