MySQL错误总结
(以大学数据库为例,持续更新中)
错误代码: 1248
Every derived table must have its own alias
每个派生出来的表都必须有一个自己的别名
//将低于整个学校的平均预算的各个学院的预算提高到原来的1.2倍。
//如果把第三行的 AS a去掉,就会报错误代码1248
UPDATE department SET budget = budget * 1.2
WHERE budget < (SELECT avg_budget
FROM( SELECT AVG( budget ) AS avg_budget FROM department ) AS a);
错误代码: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘select*
from department’ at line 92
表示语法错误,出错位置near…at line…会指出