mysql find missing values

Solutions on MaxInterview for mysql find missing values by the best coders in the world

showing results for - "mysql find missing values"
Coraline
08 Jun 2020
1-- Find missing t1 values in t2 (based on 'id' field)
2SELECT * FROM t1 WHERE t1.id NOT IN (SELECT id FROM t2);
3-- or
4SELECT * FROM t1 WHERE NOT exists (
5    SELECT NULL FROM t2 WHERE t2.id = t1.id
6);
7-- or
8SELECT t1.* FROM t1 LEFT OUTER JOIN t2 ON t2.id = t1.id WHERE t2.id IS NULL;