我正试图通过命令提示符在MySQL 8.0中创建一个临时表。select语句本身正确地返回值,但是当它被放入
CREATE TEMPORARY TABLE
声明,我得到一个错误。
我尝试了很多事情,从改变语法到其他insert语句。找不到解决方案。感谢所有能帮忙的人。
create temporary table tempTable
select game_date
,home_team
,inning
,inning_topbot
, 'innType'=case when inning_topbot='top' then away_score
else home_score
end
from pitchdata;
ERROR 1166 (42000): Incorrect column name ''innType'=case when inning_topbot='top' then away_score else home_score end'