1 year ago

#342907

test-img

leonski012

I get an error message for my temp table (Syntax error: Unexpected "(" at [2:1])

I get the error message with this:

CREATE TABLE #percent_population_vaccinated
(
    continent NVARCHAR(255),
    location NVARCHAR(255),
    date datetime,
    population numeric,
    new_vaccinations numeric,
    rolling_vaccinations numeric
)

INSERT INTO #percent_population_vaccinated
SELECT dea.continent, dea.location, dea.date, dea.population, vac.new_vaccinations
, SUM(vac.new_vaccinations) OVER (PARTITION BY dea.location ORDER BY dea.location, dea.date) AS rolling_vaccinations
FROM `my-project-0306-343712.portfolio_project_covid.covid_deaths` AS dea
JOIN `my-project-0306-343712.portfolio_project_covid.covid_vaccinations` AS vac
    ON dea.location = vac.location
    AND dea.date = vac.date
WHERE dea.continent IS NOT NULL 

SELECT *, (rolling_vaccinations/population) * 100
FROM #percent_population_vaccinated

I'm trying to follow along with the tutorial but I get stuck here.

sql

google-bigquery

temp-tables

0 Answers

Your Answer

Accepted video resources