0
您能幫我從蜂巢中的current_date獲取「MMM-yyyy」格式的時間格式嗎?需要蜂巢中「MMM-yyyy」格式的時間戳
非常感謝。
例如:
col1 col2
12-09-2016 SEP-2016
21-10-2017 OCT-2017
您能幫我從蜂巢中的current_date獲取「MMM-yyyy」格式的時間格式嗎?需要蜂巢中「MMM-yyyy」格式的時間戳
非常感謝。
例如:
col1 col2
12-09-2016 SEP-2016
21-10-2017 OCT-2017
select from_unixtime(unix_timestamp(CURRENT_DATE, 'yyyy-MM-dd HH:mm:ss'),'MMM-yyyy')
AS currentdate from db.table_name;
實施例:
hive> select from_unixtime(unix_timestamp(CURRENT_DATE, 'yyyy-MM-dd HH:mm:ss'),'MMM-yyyy')
> AS currentdate from default.test limit 1;
OK
Jul-2017
Time taken: 0.043 seconds, Fetched: 1 row(s)
hive>
由於它的工作。 – user3459623