我的结构中有一个查询正在phpmyadmin中运行。我正在尝试为olap操作运行多维数据集查询,这是我的查询:
SELECT QUARTER, REGION, SUM(SALES)
FROM salestable
GROUP BY CUBE (QUARTER, REGION)
我也尝试过这个查询:
SELECT salestable.QUARTER, salestable.REGION, SUM(salestable.SALES)
FROM salestable
GROUP BY CUBE (salestable.QUARTER, salestable.REGION)
但它显示了这个错误:
# 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(QUARTER, REGION) LIMIT 0, 25' at line 3
我试图打开页面检查语法,但它显示页面未找到。
1条答案
按热度按时间cedebl8k1#
我不认为mysql支持
CUBE
作为一个GROUP BY
修饰符,但您可以使用WITH ROLLUP
: