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.
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.
Here is what I have at the moment but I am getting a syntax error:
DELETE FROM network
WHERE ROWID in (
SELECT ROWID
FROM track
INNER JOIN network ON (track.ROWID = network.trackId)
WHERE network.timestamp > track.stopTime OR network.timestamp < track.startTime
AND network.trackId = X