title: Oracle SQL query for Date format
body: <p>I always get confused with date format in ORACLE SQL query and spend minutes together to google, Can someone explain me the simplest way to tackle when we have different format of date in database table ?</p>
  
  <p>for instance i have a date column as ES_DATE, holds data as 27-APR-12 11.52.48.294030000 AM of Data type TIMESTAMP(6) WITH LOCAL TIME ZONE. </p>
  
  <p><img src="https://i.stack.imgur.com/lND9V.jpg" alt="enter image description here"></p>
  
  <p>I wrote simple select query to fetch data for that particular day and it returns me nothing. Can someone explain me ?</p>
  
  <pre><code>select * from table
  where es_date=TO_DATE('27-APR-12','dd-MON-yy')
  </code></pre>
  
  <p>or </p>
  
  <pre><code>select * from table where es_date = '27-APR-12';
  </code></pre>