0

I am using dbeaver client connecting to Apache drill hadoop db. Trying to calculate date difference and get the output in minutes.

For Ex: Date 1 is 2015-05-17 22:00:00.000 Date 2 is 2015-05-17 22:45:00.000

Expected Output= 45.

So far I tried using TIMESTAMPDIFF but not able to get it. Please help me

Surya
  • 51
  • 1
  • 5

1 Answers1

1
0: jdbc:drill:zk=local> SELECT TIMESTAMPDIFF(MINUTE, TIMESTAMP '2015-05-17 22:00:00.000', TIMESTAMP '2015-05-17 22:45:00.000');
+---------+
| EXPR$0  |
+---------+
| 45      |
+---------+
1 row selected (0.678 seconds)

see more info in Drill docs: https://drill.apache.org/docs/date-time-functions-and-arithmetic/#timestampdiff

Vitalii Diravka
  • 855
  • 6
  • 11