title: Oracle SQL , how to use current date - a specified date
body: <p>For getting current date i use this..</p>
  
  <pre><code>select extract(year from sysdate) from dual;
  </code></pre>
  
  <p>For getting the date that my database hold i use this..</p>
  
  <pre><code>select extract(year from startdate) from staff;
  </code></pre>
  
  <p>But now i am trying to update a field call serviceYears inside staff, by using </p>
  
  <p><code>current year - year of start date</code> </p>
  
  <p>to get the amount of years the staff have committed to work. how do i achieve it..</p>
  
  <p>i am using oracle sql</p>
  
  <p><strong>Thanks!</strong></p>
  
  <p>I tried to use </p>
  
  <pre><code>SQL&gt; select dual.sysdate-staff.startdatefrom dual,staff;
  
  select dual.sysdate-staff.startdatefrom from dual,staff
              *
  ERROR at line 1:
  ORA-01747: invalid user.table.column, table.column, or column specification
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>select SYSDATE-to_date('01-jan-2007','dd-mon-yyyy') from dual;
  
  But it return me
  SYSDATE-TO_DATE('01-JAN-2007','DD-MON-YYYY')
  --------------------------------------------
                                    2136.93719
  </code></pre>
  
  <p>How do i just get the year?</p>