select(select SUM(HOME_SCORE) total from MATCH )
+
(select SUM(AWAY_SCORE) total from MATCH)
as "GOALS SCORED"
From dual ;
这是为了返回HOME_SCORE和AWAY_SCORE的总和我得到以下错误
从命令行中的第242行开始出错 - 选择(从MATCH中选择SUM(HOME_SCORE)总计) 错误报告 - 未知命令
从命令行开始出错:243 - + 错误报告 - 未知命令
查询运行:查询结果
答案 0 :(得分:-1)
如果您想要这样做,也许您缺少括号请将您的脚本重写为此select((select SUM(HOME_SCORE) total from MATCH )
+
(select SUM(AWAY_SCORE) total from MATCH))
as "GOALS SCORED"
From dual ;
或为简化此操作,您可以尝试此select(select SUM(HOME_SCORE) + SUM(AWAY_SCORE) total from MATCH )
as "GOALS SCORED"
From dual ;