Hello,

This must be something very simple for experienced SQL/SQLite users,
but I don't know how to write this query: I have two tables ("code"
and "companies", with code.id being used as foreign key as
companies.code).

I'd like to fetch all the rows in "code" that don't exist in
"companies":

SELECT code.id FROM code,companies WHERE code.id IS NOT IN (SELECT
code FROM companies);

This doesn't work, but I'm not sure if it's due to SQLite or my wrong
SQL query.

Thank you for any tip.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to