M
M
Murad Nurmagomedov2016-01-19 17:18:55
MySQL
Murad Nurmagomedov, 2016-01-19 17:18:55

How to check for missing records in MySQL?

Hello.
There is a list of values. Of these, some are present in the table and some are not. How can I find out which values ​​are missing in the table?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
red_led, 2016-01-19
@red_led

SELECT * FROM t1 WHERE NOT EXISTS (SELECT * FROM t2 where t1.id = t2.id);

A
Alexey S., 2016-01-19
@Winsik

Select values ​​that are not in the table

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question