title: UNION DISTINCT with LIMITs
body: <p>Can someone please explain how this query gets interpreted by server?</p>
  
  <pre><code>(select * from mytable where &lt;some condition&gt; LIMIT 13)
  UNION DISTINCT
  (select * from mytable where &lt;some other condition&gt; LIMIT 103)
  UNION DISTINCT
  (select * from mytable where &lt;some other condition&gt; LIMIT 71) LIMIT 43;
  </code></pre>
  
  <p>When I tried it, it returned me 43 rows. And when I removed last <code>LIMIT 43</code> it returned me 71 rows. </p>
  
  <p>So does it mean MySQL considers only last specified <code>LIMIT</code> and keeps <code>UNION</code>ing all <code>DISTINCT</code> rows from each <code>SELECT</code>s <em>untill</em> it reaches to that <code>LIMIT</code>? or how else does it work?</p>