title: Comparison between a DATE and a VARCHAR: How does it work?
body: <p>I have the following condition:</p>
  <pre class="lang-sql prettyprint-override"><code>WHERE ORDER_DATE &gt;= TO_DATE (CURRENT_DATE, 'YYYY-MM-DD')
  </code></pre>
  <p>The left part (<code>ORDER_DATE</code>) is stored as a <code>VARCHAR</code> and the right part is a <code>DATE</code>.
  When I run the code I have no error; meaning that the comparison between a <code>VARCHAR</code> and a <code>DATE</code> is working.
  I feel like the <code>VARCHAR</code> is converted in a <code>DATE</code> and then the comparison operator is applied; when I have <code>'0000-00-00'</code> data in the <code>ORDER_DATE</code> it returns a format error (<code>data exception - invalid value for YYYY format token; Value: '0000-00-00'</code>).
  Can someone confirm that my hypothesis is right?</p>
  <p>*Yes I know I should store or convert my <code>VARCHAR</code> in a <code>DATE</code> and then perform my comparison between two <code>DATE</code> and this is what I have done. However, I noticed this particularity and I would like to understand the reason behind!</p>