title: Union and union all in oracle Database
body: <p>While executing the below two queries (focus on the part between two asterisks * ____ *), I am really wondering how does the position of UNION ALL changes the output. I am unable to understand. </p>
  
  <p>Query 1 </p>
  
  <pre><code>SELECT 'Jack' AS Name, 100 AS Marks FROM DUAL 
  *UNION All SELECT 'Jack' AS Name, 100 AS Marks FROM DUAL*
  UNION SELECT 'Jack' AS Name, 100 AS Marks FROM DUAL
  </code></pre>
  
  <p>Query Result</p>
  
  <pre><code>NAME    MARKS
  Jack    100
  </code></pre>
  
  <p>Query 2 </p>
  
  <pre><code>SELECT 'Jack' AS Name, 100 AS Marks FROM DUAL 
  UNION SELECT 'Jack' AS Name, 100 AS Marks FROM DUAL 
  *UNION ALL SELECT 'Jack' AS Name, 100 AS Marks FROM DUAL*
  </code></pre>
  
  <p>Query Result</p>
  
  <pre><code>NAME    MARKS
  Jack    100
  Jack    100
  </code></pre>
  
  <p>Thanks :)</p>