Hi,
I am getting the following error for following query I am trying to run. Anyone can advise what is the issue here? Can't find the reason behind this issue. Thanks in advance!
QUERY:
SELECT death.continent, death.location, death.date, population, vaccine.new_vaccinations,
SUM(CONVERT(INT,vaccine.new_vaccinations)) OVER (partition by death.location ORDER BY death.location,death.date) RollingPeopleVaccinated
FROM [Portfolio project]..['covid_deaths'] death
JOIN [Portfolio project].. ['covid_vaccinations'] vaccine
ON death.location = vaccine.location
AND death.date = vaccine.date
WHERE death.continent is not NULL
ORDER BY 2,3
ERROR:
ORDER BY list of RANGE window frame has total size of 1020 bytes. Largest size supported is 900 bytes.
August 23, 2021 at 5:11 pm
that death.location column is bigger than 1k bytes I would assume by the error.
but do give has the ddl for the 2 tables involved.
August 23, 2021 at 5:57 pm
death.column size in the table or name itself is the problem here?
size of the column
e.g. varchar(xxxx)
so do give the ddl as asked.
August 23, 2021 at 7:45 pm
Got it! Thanks!
August 31, 2021 at 1:08 pm
Yes. It worked when I changed the column size. This is what worked for me:
ALTER TABLE 'table name' ALTER COLUMN 'column name' nvarchar(150)
November 21, 2021 at 11:01 am
Hi,
What exactly was your final code? I am struggling with this same issue while trying to follow a YouTube tutorial by Alex the Analyst.
Many thanks.
February 4, 2022 at 12:41 pm
In case anyone is looking at this in the future -
converting the date as date worked for me too, but it did take a while to run the query.
If anyone can say what the best approach is that would be great.
Select cd.continent, cd.location, cd.date, cd.population, cv.new_vaccinations,
SUM(CONVERT(bigint, cv.new_vaccinations)) OVER
(Partition by cd.location Order by cd.location, CONVERT(date, cd.date))
From PortfolioProject..CovidDeaths cd
Join PortfolioProject..CovidVaccinations cv
On cd.location = cv.location
and cd.date = cv.date
Where cd.continent is not null
Order by 2, 3
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy