首页 > 解决方案 > 语法错误:预期输入结束,但在

问题描述

这是我试图在 BigQuery 中运行的内容,但不断收到错误代码。我究竟做错了什么?

#显示吸烟者的死亡人数

select dea.location, dea.population, gen.female_smokers, gen.male_smokers
sum(female_smokers) as TotalFemales, sum(gen.male_smokers) as TotalMale over (PARTITION BY dea.location order by dea.location, dea.population) as RollingWomen
FROM capstone-project-317016.Portfolio1.CovidDeaths dea;
join capstone-project-317016.Portfolio1.CovidbyGender gen
on dea.location = gen.location
and dea.population = gen.population
where dea.location is not null
group by dea.population

标签: google-bigquerydata-analysis

解决方案


在 gen.male_smokers 第 1 行后添加逗号

之前必须有一些聚合函数(PARTITION BY dea.location order by dea.location, dea.population)作为 RollingWomen


推荐阅读