Sunday 13 November 2022

Hive: datediff: Difference between two dates

Signature

datediff(string date1, string date2)
hive> SELECT datediff('2021-01-12', '2021-05-12');
OK
_c0
-120
Time taken: 0.051 seconds, Fetched: 1 row(s)
hive> SELECT datediff('2021-05-12', '2021-01-12');
OK
_c0
120
Time taken: 0.039 seconds, Fetched: 1 row(s)

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment