MySQL:Trying 到 运行 CUBE 查询 -> sql 语法错误 |限制 0,25
MySQL:Trying to run CUBE query -> Error in your sql syntax | LIMIT 0,25
我在我的结构中有查询尝试在 PHPMYADMIN 中 运行。我正在尝试 运行 CUBE 查询 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
我试图打开页面检查语法,但它显示 page not found。
我认为 MySQL 不支持 CUBE
作为 GROUP BY
modifier,但您可以使用 WITH ROLLUP
:
SELECT st.QUARTER, st.REGION, SUM(st.SALES)
FROM salestable st
GROUP BY st.QUARTER, st.REGION WITH ROLLUP;
我在我的结构中有查询尝试在 PHPMYADMIN 中 运行。我正在尝试 运行 CUBE 查询 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
我试图打开页面检查语法,但它显示 page not found。
我认为 MySQL 不支持 CUBE
作为 GROUP BY
modifier,但您可以使用 WITH ROLLUP
:
SELECT st.QUARTER, st.REGION, SUM(st.SALES)
FROM salestable st
GROUP BY st.QUARTER, st.REGION WITH ROLLUP;