SQLite doesn't do the full outer join thing, so you have to fake it with two left outer joins :
-- in table2 but not in table1:
SELECT r.id
FROM table2 AS r
LEFT JOIN table1 AS l
ON r.id = l.id
WHERE
r.system = ?
and l.id IS NULL
and r.id IS NOT NULL
-- in table1 but not in table2:
SELECT l.id
FROM table2 AS l
LEFT JOIN table1 AS r
ON l.id = r.id
WHERE
l.system = ?
and l.id IS NOT NULL
and r.id IS NULL
SQL
But other than that, SQLite is up to the task, as it includes a nice bulk import statement (SQLite 2.x) and a bulk loader program (SQLite 3.x).
Update: Added the "full" to "full outer join", as a "left (outer) join" is an outer join too, but one which SQLite does... |