title: Extracting the total number of seconds from an interval data-type
body: <p>When subtracting <code>timestamps</code> the return value is an <code>interval</code> data-type. Is there an elegant way to convert this value into the total number of (milli/micro) seconds in the interval, i.e. an integer.</p>
  
  <p>The following would work, but it's not very pretty:</p>
  
  <pre><code>select abs( extract( second from interval_difference ) 
            + extract( minute from interval_difference ) * 60 
            + extract( hour from interval_difference ) * 60 * 60 
            + extract( day from interval_difference ) * 60 * 60 * 24
              )
    from ( select systimestamp - (systimestamp - 1) as interval_difference
             from dual )
  </code></pre>
  
  <p>Is there a more elegant method in SQL or PL/SQL?</p>