hive> with t as (select date '2017-02-05' as PLAN_REPAYMENT_DATE_KEY)
> select date_format(PLAN_REPAYMENT_DATE_KEY,'dd.MM') from t;
OK
05.02
hive> with t as (select date '2017-02-05' as PLAN_REPAYMENT_DATE_KEY)
> select from_unixtime(unix_timestamp(PLAN_REPAYMENT_DATE_KEY),'dd.MM') from t;
OK
05.02
hive> with t as (select date '2017-02-05' as PLAN_REPAYMENT_DATE_KEY)
> select printf('%02d.%02d',day(PLAN_REPAYMENT_DATE_KEY),month(PLAN_REPAYMENT_DATE_KEY)) from t;
OK
05.02
2条答案
按热度按时间ffvjumwh1#
编辑:也在当天添加了lpad。
gc0ot86w2#