79241427

Date: 2024-12-01 11:14:20
Score: 0.5
Natty:
Report link

You can try this one to calcualte time in 2 database columns like that.

select END_TIME, START_TIME,to_char(END_TIME,'HH24') end_time, to_char(START_TIME,'HH24') start_time, case when (to_number(to_char(START_TIME,'HH24')) > 12) then extract( HOUR from ( cast(END_TIME+ INTERVAL '1' DAY AS TIMESTAMP) - cast( START_TIME AS TIMESTAMP) ) ) else extract( HOUR from ( cast(END_TIME AS TIMESTAMP) - cast(START_TIME AS TIMESTAMP) ) ) end working_hours from DB_TABLE

Reasons:
  • Whitelisted phrase (-1): try this
  • No code block (0.5):
  • Low reputation (1):
Posted by: Md. Forhad