by shigemk2

当面は技術的なことしか書かない

presto date_diff week month

date_diffってweekとかmonth単位でもいけちゃうんだね。 (EMRでPresto 0.187だけど)

select date_diff('week', timestamp '2017-01-01 00:00:00', timestamp '2018-10-10 23:59:59') + 1;
 _col0
-------
    93
(1 row)

select date_diff('month', timestamp '2017-01-01 00:00:00', timestamp '2018-10-10 23:59:59') + 1;
 _col0
-------
    22
(1 row)

6.13. Date and Time Functions and Operators — Presto 0.212 Documentation