title: effective_end_date not 31-dec-4712 in sql query
body: <p>I have a table tab_assignment_xx</p>
  
  <pre><code>date_from   date_end     action  person_number
  01-Apr-2014 31-Jul-2014   HIRE   050498
  01-Aug-2014 31-Jan-2015   OTHERS    050498
  01-Feb-2015 30-Jun-2015   OTHERS    050498
  01-Jul-2015 15-Nov-2015   OTHERS    050498
  16-Nov-2015 31-Dec-2015 OTHERS  050498
  01-Jan-2016 30-JAN-2016 OTHERS  050498
  
  01-APR-2016  31-JUL-2016   hire    83982
  01-jan-2015  31-dec-4712   Others   6447
  </code></pre>
  
  <p>Now i want to check for all those particular employees with effective_start_date and effective_End_date that it should have 31-dec-4712 as <code>max(effective_end_date)</code> for example : for 050498 the max(effective_end_date) is not '31-dec-4712' and same goes for 83982. 6447 is correct.</p>
  
  <p>for this i made :</p>
  
  <pre><code>  select * from (
      select T.*,
        max(EFFECTIVE_START_DATE) over (partition by PERSON_NUMBER order by EFFECTIVE_START_DATE) MAX_FROM
      from  tab_assignment_xx T
      where 1=1
      --T.PERSON_NUMBER = '093343'
      AND ASSIGNMENT_TYPE='E'
    )
    where MAX_FROM &lt;&gt; to_date('31-DEC-4712')
  ;
  </code></pre>
  
  <p>But this is not working in the sense that it is both the rows with and without 31-dec-4712 max eff end date</p>