Answer the question
In order to leave comments, you need to log in
SQL query for not in set?
The people help with request (mysql).
Table of applications, Table of photos on applications.
I need to list the numbers of those orders that are not in the table with photos (i.e. I need a list of orders that do not have photos)
I do something like:
SELECT num FROM customerequipment WHERE num NOT IN (SELECT OrderID from attaches).
But returns null
Answer the question
In order to leave comments, you need to log in
As an option:
SELECT
num
FROM customerequipment m
WHERE NOT EXISTS (
SELECT
1
FROM attaches e
WHERE e.OrderID = m.num
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question