【发布时间】:2021-09-01 21:29:35
【问题描述】:
语法错误:预期输入结束,但在 bigquery 中的 [11:1] 处出现关键字 INSERT 错误
create table percentpopulationvaccinated
(
continent string,
Location string,
Date datetime,
population numeric,
new_vaccinations numeric,
peoplevaccinated numeric
)
insert into percentpopulationvaccinated
select
dea.continent, dea.location, dea.date, dea.population,
new_vaccinations,
sum(vac.new_vaccinations) over (partition by dea.location order by dea.location, dea.date) as peoplevaccinated
from
my-protfolio-324718.sql_code.covid_deaths dea
join
my-protfolio-324718.sql_code.covid_vac vac on dea.location = vac.location
and dea.date = vac.date
select
*,
(peoplevaccinated / population) * 100
from
percentpopulationvaccinated
【问题讨论】:
-
您有一个包含两个语句(创建和插入)的脚本。所有语句都必须用
;分隔,所以在insert和前面的)之间添加它,你应该没问题,直到可能出现下一个/另一个错误:o)
标签: sql google-bigquery