Getting around the over (partition by) clause in mySQL

296 views Asked by At

I have been trying to run this query in order to get a rolling count of people vaccinated in different locations but have been receiving a syntax error and I am not sure what to do

Here's the query;

SELECT 
    dea.continent,
    dea.location,
    dea.date,
    dea.population,
    vac.new_vaccinations,
    SUM(CONVERT(INT, vac.new_vaccinations)), OVER (PARTITION BY dea.location order by dea.location, dea.date)as RollingCountPeopleVaccinated
    FROM  
    CovidDeaths dea
    JOIN CovidVaccinations vac
      ON 
     dea.location= vac.location and
     dea.date= vac.date
     where dea.continent is not null
    ORDER BY
    1,2,3

and the result:

Execution finished with errors. Result: near "BY": syntax error At line 161:

SELECT 
    dear.continent,
    dea.location,
    dea.date,
    dea.population,
    vac.new_vaccinations,
    SUM(CONVERT(INT, vac.new_vaccinations)), OVER (PARTITION BY

What does this error mean?

0

There are 0 answers