title: What is the difference between 'YYYY' and 'RRRR' in Oracle SQL
body: <p>I have 2 queries in SQL:</p>
  
  <pre><code>select trunc(to_date('27-Jul-1987'),'YYYY') FROM dual; 
  </code></pre>
  
  <p>and </p>
  
  <pre><code>select trunc(to_date('27-Jul-1987'),'RRRR') FROM dual; 
  </code></pre>
  
  <p>Both are giving me the same result. What is the difference between 'RRRR' and 'YYYY'?</p>