Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calculate Time difference between min and max times.

882d742e-17ff-4d5a-9628-eb7e6304a6aeSep 10 2019 — edited Sep 10 2019

Hi All, I wonder if you can help me here?

I am a novice SQL user and need some guidance on how to sort a time/ date query out.

my query is:

SELECT

client_id,

code,

to_loc_id,

pallet_id,

Min (dstamp) AS First,

Max (dstamp) AS Last

FROM inventory_transaction

WHERE Pallet_id ='450218970030400074'

AND Client_id = 'DIV'

AND Code = 'Pick'

AND to_loc_id = 'CONTAINER'

group BY client_id,code,to_loc_id,pallet_id

result:

pastedImage_0.png

I need to calculate the time difference between the first and last.

how do I go about this?

Comments
Post Details
Added on Sep 10 2019
5 comments
2,741 views