title: calculate time difference between two dates in seconds using oracle
body: <p>I am calculating sum of total records between 6 and 59 sec, not working.</p>
  
  <pre><code>sum(
      case trunc((d.start_date-s.end_date)*24*60*60)
      when between 6 and 59 then 1
      end) as onemin
  from employee; 
  </code></pre>