我有2列我要轉換爲VARCHAR處理並串連將它們放置在一列:蜂巢 - 轉換詮釋爲varchar和串聯
我將如何做到這一點的蜂巢?我不斷收到的問題時,我嘗試在SQL正常的方式...
round(min(temp) over (partition by temp2, temp3) min,
round(max(temp)) over (partition by temp2, temp3) max
*original columns*
min max
0 100
============================ =========
*new column*
min-max
$0-$100
答:
這個工作對我.....
concat('$',cast(round(min(temp)) as string), ' - $', cast(round(max(temp)) as string)) over (partition by temp2, temp3) newColumn
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-TypeConversionFunctions – Tomalak 2014-12-02 15:19:39
thanxx用於鏈路...... – 2014-12-02 15:56:56