I like to use the statement NOT IN, like
SELECT * FROM table1 WHERE id NOT IN ( SELECT id FROM table2 )
I’ve used it in MS SQL but it does not seem to work in mySQL, is there any other statement I could use?
That'll work in MySQL, provided you have a current version that supports subqueries.
If you're used to MSSQL you might wanna look at firebirdsql or postgresql, both of which are more fully fleshed out in respect to the SQL spec and tend to run complex queries much faster than MySQL.
Originally posted by Sxooter If you're used to MSSQL you might wanna look at firebirdsql or postgresql, both of which are more fully fleshed out in respect to the SQL spec and tend to run complex queries much faster than MySQL.
Amen brother 🙂