sql - hive error, getting an EOF error in subtract query -


i getting an, missing eof @ '-' near hab, query part looks correct. not sure how implement minus in hive.

select     a.playerid id,     a.yearid yearid,     (b.hab - a.eg) hab-eg      (select         playerid,         yearid,         (e/g) eg     fielding     (             yearid > 2005             , yearid < 2009             , g > 20              )     ) join     (select         id,         year,         (hits/ab) hab     batting     where(              year > 2005             , year < 2009              , ab > 40              )     ) b on a.playerid = b.id , a.yearid = b.year; 

alias names should quoted backtick character (``) characters, when include additional character such space or dash.
use following:

select     a.playerid id,     a.yearid yearid,     (b.hab - a.eg) `hab-eg` 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -