I want to select all entries from the table named carpooling where time difference between ends_on and start_on is 1 hour can someone help me in writing query with explanation? i have attached images in links below.
click here for query reference
CodePudding user response:
Try this, converts timestamp to date and substracts on day basis
select *
from carpooling
where trunc(cast(ends_on as date),'mi')-trunc(cast(start_on as date),'mi')=1/24