mysql 在该位置无效,需要 eof
SELECT ref,
Sum(transactions.amount)
OVER(
ORDER BY id)
FROM transactions
localhost mysql phpmyadmin 运行代码没有任何问题。但是,当上传到heroku ClearDB时,显示“mysql在此位置无效,期待eof”错误
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MySQL 不支持窗口函数 (例如
SUM OVER()
) 直到版本8:但是 ClearDB 默认为版本 5.6 并且不不提供比 5.7 版本更新的任何内容。
不过,还有其他提供 MySQL 的 Heroku 插件:
我建议您切换到 JawsDB for MySQL。配置附加组件,将数据复制从 ClearDB 到 JawsDB,并将您的应用程序指向 JawsDB。一旦确定一切正常,您就可以取消配置 ClearDB 数据库。
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.