我在港湾附近的“-”得到一个丢失的eof,大部分查询看起来是正确的。只是不知道如何在Hive中实现减号。
SELECT
a.playerID AS ID,
a.yearID AS yearID,
(b.HAB - a.EG) AS HAB-EG
FROM
(SELECT
playerID,
yearID,
(E/G) AS EG
FROM fielding
WHERE (
yearID > 2005
AND yearID < 2009
AND G > 20
)
) AS a
JOIN
(SELECT
id,
year,
(hits/ab) AS HAB
FROM batting
WHERE(
year > 2005
AND year < 2009
AND ab > 40
)
) AS b ON a.playerID = b.id AND a.yearID = b.year;
1条答案
按热度按时间aiqt4smr1#
别名应该用引号引起来
backtick character (``)
字符,包括任何附加字符(如空格或破折号)。因此,请使用以下命令: