您能帮我从配置单元中的当前日期获取“mmm yyyy”格式的时间格式吗?提前多谢了。例如:
col1 col2 12-09-2016 SEP-2016 21-10-2017 OCT-2017
eanckbw91#
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>
1条答案
按热度按时间eanckbw91#
例子: