SELECT ref,
Sum(transactions.amount)
OVER(
ORDER BY id)
FROM transactions
localhost mysql phpmyadmin runs the code with no problems. However when uploading to heroku ClearDB "mysql is not valid at this position expecting eof" error shows
MySQL didn't support window functions (e.g.
SUM OVER()) until version 8:But ClearDB defaults to version 5.6 and doesn't offer anything newer than version 5.7.
There are other Heroku addons that provide MySQL, though:
I suggest you switch to JawsDB for MySQL. Provision the add-on, copy your data from ClearDB to JawsDB, and point your application to JawsDB. Once you're sure everything is working you can de-provision the ClearDB database.