title: Combine two statements with LIMITS using UNION
body: <p>Is there a way to combine these two statements into one without having duplicate entries?</p>
  
  <pre><code>SELECT * FROM Seq where JULIANDAY('2012-05-25 19:02:00')&lt;=JULIANDAY(TimeP) 
           order by TimeP limit 50
  
  SELECT * FROM Seq where JULIANDAY('2012-05-29 06:20:50')&lt;=JULIANDAY(TimeI)  
           order by TimeI limit 50
  </code></pre>
  
  <p>My first, obvious attempt is not supported by <code>SQLITE</code> (Syntax error: Limit clause should come after UNION not before):</p>
  
  <pre><code>SELECT * FROM Seq where JULIANDAY('2012-05-25 19:02:00')&lt;=JULIANDAY(TimeP) 
           order by TimeP limit 50
  UNION
  SELECT * FROM Seq where JULIANDAY('2012-05-29 06:20:50')&lt;=JULIANDAY(TimeI)
           order by TimeI limit 50
  </code></pre>