你能幫我克服當我嘗試創建下表時遇到的錯誤嗎?Hive創建表錯誤。
感謝
CREATE TABLE RANGE_FT (HOSP_VAR STRING, RANGE INT)
AS
SELECT 'EMR' ,MAX(emr_avg_score) - MIN(emr_avg_score) from JOIN9
UNION SELECT 'SCI' ,MAX(sci_avg_score) - MIN(sci_avg_score) from JOIN9
UNION SELECT 'ASTH' ,MAX(asth_avg_score) - MIN(asth_avg_score) from JOIN9
UNION SELECT 'HF' ,MAX(hf_avg_score) - MIN(hf_avg_score) from JOIN9
UNION SELECT 'SC' ,MAX(sc_avg_score) - MIN(sc_avg_score) from JOIN9
UNION SELECT 'PNEU' ,MAX(pneu_avg_score) - MIN(pneu_avg_score) from JOIN9
UNION SELECT 'PREV' ,MAX(prev_avg_score) - MIN(prev_avg_score) from JOIN9
UNION SELECT 'BC' ,MAX(BC_avg_score) - MIN(BC_avg_score) from JOIN9
UNION SELECT 'HEART' ,MAX(heart_avg_score) - MIN(heart_avg_score) from JOIN9
UNION SELECT 'PREG' ,MAX(preg_avg_score) - MIN(preg_avg_score) from JOIN9
;
線7:6 ALL在 'SELECT'
試試SET NOCOUNT查詢 –
之前,請用文本替換圖像(粘貼後,選中它,然後按CTRL + K對其進行格式化代碼) –
嗨辛格,謝謝你你的幫助。你可以更加關於如何設置nocount嗎?我的意思是我應該把這個命令放在哪裏。我的代碼是:DROP TABLE RANGE_FT; CREATE TABLE RANGE_FT (HOSP_VAR STRING, RANGE INT) AS SELECT 'EMR',MAX(emr_avg_score) - 從JOIN9 MIN(sci_avg_score) - MIN(emr_avg_score)從JOIN9 UNION SELECT 'SCI',MAX(sci_avg_score) 來自JOIN9的UNION SELECT'ASTH',MAX(asth_avg_score)-min(asth_avg_score)來自JOIN9的UNION SELECT'HF',MAX(hf_avg_score)-min(hf_avg_score) –