使用over()和别名时出现mysql错误 [英] mysql error when using over() and an alias

查看:50
本文介绍了使用over()和别名时出现mysql错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用phpMyAdmin控制台和MariaDB 10.2,如果将over()函数与别名结合使用,则会出现各种错误:

Using the phpMyAdmin console and MariaDB 10.2, if I combine the over() function with an alias I get a variety of errors:

SELECT AVG(foo) OVER() AS bar FROM some_table

  • 先前已找到别名(在栏附近)
  • 意外令牌(靠近栏)
  • 应该是别名(在附近)<-只是一个空白
  • 这些具有任一功能的语句不会给我错误

    these statements with either one function don't give me errors

    SELECT AVG(foo) AS bar FROM some_table
    
    SELECT AVG(foo) OVER() FROM some_table
    

    我能找到的所有内容都暗示这些错误来自基本错误,例如逗号不合时宜,或者使用保留关键字作为别名.我认为我没有做任何事情.

    All of the stuff I can find implies that these errors come from basic mistakes, like having a comma out of place, or using reserved keywords as aliases. I don't think I'm doing any of that.

    推荐答案

    看来phpMyAdmin用于验证语法的linter尚未针对似乎由MariaDB 10.2引入的此语法进行更新.烦人的同时,您可以忽略警告并继续运行查询.

    It appears the linter that phpMyAdmin uses for verifying syntax hasn't been updated for this syntax that seems to have been introduced with MariaDB 10.2. While it's annoying, you can ignore the warnings and run your query anyway.

    我在 https://github.com上打开了有关此错误的报告./phpmyadmin/sql-parser/issues/197 ,您可以在其中继续进行操作,直到修复该错误为止.

    I've opened a bug report about it at https://github.com/phpmyadmin/sql-parser/issues/197, where you can follow along until the bug is fixed.

    这篇关于使用over()和别名时出现mysql错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆