select datetime[0] as 年 ,datetime[1] as 小时 from (select split(from_unixtime(unix_timestamp('20150125145900','yyyyMMddhhmmss'),'yyyy-MM-dd HH:mm:ss'),' ') as datetime)e ``` year hour 2015-01-25 02:59:00
select ts[0] as year
,ts[1] as hour
from (select split(from_unixtime(unix_timestamp('20150125145900','yyyyMMddHHmmss')
,'yyyy-MM-dd HH:mm:ss'),' ') as ts
) t
select split_part(ts,' ',1) as year
,split_part(ts,' ',2) as hour
from (select from_unixtime(unix_timestamp('20150125145900','yyyyMMddHHmmss')
,'yyyy-MM-dd HH:mm:ss') as ts
) t
;
2条答案
按热度按时间js81xvg61#
select datetime[0] as
年,datetime[1] as
小时from (select split(from_unixtime(unix_timestamp('20150125145900','yyyyMMddhhmmss'),'yyyy-MM-dd HH:mm:ss'),' ') as datetime)e
```year hour
2015-01-25 02:59:00
zyfwsgd62#
Hive
Impala