Answer the question
In order to leave comments, you need to log in
How to return only those rows that don't have an associated row in another table?
There are two tables person and sms. Linked to each other by id. Almost all person strings have an associated sms string. But some person strings don't have sms string yet, how to return only those person strings?
Answer the question
In order to leave comments, you need to log in
SELECT person.*
FROM person
LEFT JOIN sms ON sms.id = person.id
WHERE sms.id IS NULL
In the query, link two tables LEFT OUTER JOIN and put a filter on an empty sms.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question