title: calculate hours based on business hours in Oracle SQL
body: <p>I am looking to calculate hours between a start and end of time of a task based on business hours. I have the following sample data:</p>
  
  <pre><code>TASK | START_TIME | END_TIME
  A | 16-JAN-17 10:00 | 23-JAN-17 11:35
  B | 18-JAN-17 17:53 | 19-JAN-17 08:00
  C | 13-JAN-17 13:00 | 17-JAN-17 14:52
  D | 21-JAN-17 10:00 | 30-JAN-17 08:52
  </code></pre>
  
  <p>and I need to work out the difference between the two but based on the following business hours:</p>
  
  <pre><code>Mon - Sat 08:00 - 18:00
  </code></pre>
  
  <p>I know how to write the calculation but not sure what I do to add the business hours into the calculation. </p>
  
  <p>Any advice would be appreciated.</p>