title: Delete rows with inner join?
body: <p>I have a SQLITE database with two tables. Table A has an integer timestamp and another integer column containing a row id referring to a row in table B which has two timestamps.</p>
  
  <p>I want to delete all rows in table A where it's timestamp does not lie between the two timestamps in table B, and the ROWID is equal to X.</p>
  
  <p>Here is what I have at the moment but I am getting a syntax error:</p>
  
  <pre><code>DELETE FROM network
  WHERE ROWID in (
      SELECT ROWID 
      FROM track 
      INNER JOIN network ON (track.ROWID = network.trackId) 
      WHERE network.timestamp &gt; track.stopTime OR network.timestamp &lt; track.startTime 
          AND network.trackId = X
  </code></pre>