I have two tables and want to compare rows on sqlite like this
x
table1 table2
field1 field1
a a
b d
c f
d g
e
f
g
h
i
and I want to produce result like this
result_table
field1
b
c
e
h
i
How is the syntax in sqlite? Thanks
Advertisement
Answer
SELECT DISTINCT Field1
FROM Table1
WHERE Field1 Not IN
(SELECT DISTINCT Field1 FROM Table2)