在mysql下使用SELECT INTO语句会产生ERROR 1327 (42000): Undeclared variable:new_tablename
此时要使用:
CREATE TABLE CYRTEMP(SELECT Cno,COUNT(Sno),AVG(Score)
FROM CYRReports
GROUP BY(Cno));
来替代原句:
SELECT Cno,COUNT(Sno),AVG(Score)
INTO SUM_AVGSco
FROM CYRReports
GROUP BY(Cno);
时间: 2024-12-09 21:29:37