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