Mysql
 sql >> Database >  >> RDS >> Mysql

Query ottimizzata per MySQL per non in

Usa un join esterno

SELECT A.*
FROM Table1 a
LEFT OUTER JOIN (SELECT DISTINCT subject
            FROM Table2) b ON a.id = b.subject
WHERE b.subject IS NULL