title: Oracle: subtract millisecond from a datetime
body: <p>I thought it was really simple but it isn't.</p>
  
  <pre><code>SELECT TO_TIMESTAMP('10/08/2012','DD/MM/YYYY') 
            - 1/(24*50*60*1000) data 
  FROM dual;
  </code></pre>
  
  <p>It simply doesn't work.</p>
  
  <hr>
  
  <p>Other details:</p>
  
  <pre><code>SELECT TO_TIMESTAMP('10/08/2012','DD/MM/YYYY') -
             NUMTODSINTERVAL(1/(24*50*60*1000),'HOUR') data 
  FROM dual;
  </code></pre>
  
  <p>doesn't work..</p>
  
  <p>The right seems to be</p>
  
  <pre><code>SELECT TO_TIMESTAMP('10/08/2012','DD/MM/YYYY') -
             NUMTODSINTERVAL(1/(24*25*60*1000),'HOUR') data 
  FROM dual;
  </code></pre>
  
  <p>Why? How does it work?</p>