SQLite Forum

Find rows not in other sub query?
Login
Thanks.

It looks like there's something wrong my data. I'll investigate.

<code>
SELECT COUNT(*) FROM main;
5854

SELECT COUNT(*) FROM zip;
35074

SELECT COUNT(*) FROM main,zip WHERE main.ZIP=zip.ZIP;
5905

SELECT COUNT(*) FROM zip WHERE zip.ZIP NOT IN (SELECT main.ZIP FROM main);
34769
</code>