1
我嘗試導入SQL文件MySQL數據庫,但我遇到一個問題:WITH ROLLUP的不正確使用和DISTINCT
ERROR 1221 (HY000) at line 4598: Incorrect usage of WITH ROLLUP and DISTINCT
DROP PROCEDURE IF EXISTS `sp_employees_rollup`$$
CREATE PROCEDURE `sp_employees_rollup`()
BEGIN
SELECT Distinct City ,Sum(Salary) Salary_By_City FROM employees
GROUP BY City WITH ROLLUP;
END $$
DELIMITER ;
多數民衆贊成在我的想法,但我不知道。謝謝。 – Tomasz