title: Select an hour interval between two date SQL Oracle 11g
body: <p>I'm writing a trigger for an online videogame project for my university, and this trigger was intended for putting an advertising after 8 hours of game (with a DBMS Output on the trigger I guess).</p>
  
  <p>But i'm having trouble calculate this difference : </p>
  
  <p>For example, I got :</p>
  
  <pre><code>LOGINDATE              LOGOUTDATE
  --------------------   --------------------
  15-MAG-2017 23:15:42   16-MAG-2017 02:15:54
  </code></pre>
  
  <p>In the trigger I would like to take the total amount of hours subtracting it from LOGINDATE-LOGOUTDATE, and saving that into a variabile MAX_HOURS that will do the trick into an IF STATEMENT ( IF MAX_HOURS > 8, for example ) </p>
  
  <p>Is there some way to do this ?</p>