Home > database >  how to find hourly time difference all record from sql table in oracle 11g?
how to find hourly time difference all record from sql table in oracle 11g?

Time:04-22

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.

table reference

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
  • Related