I have a query:
SELECT DISTINCT phone
FROM contacts
WHERE (phone='123456' OR phone='456789' OR phone='789789')
AND deleted=0 AND user=1
This will show me all rows that are in the contacts table, and they are not deleted. How can I return the values that are not found in the contacts table?
Note: There is no found field in my table. That's what i want to return
For example:
| Phone | deleted | found |
|-----------|---------|-------|
| 123456 | 0 | YES |
| 456789 | 1 | YES |
| 789789 | 0 | NO | <---
Thanks, Nicos
SELECT DISTINCT(phone) FROM contacts WHERE (phone = '123456' OR phone = '456789' OR phone = '789789') AND deleted = 0 AND found = 'NO' AND user = 1. You should use the "found" column too I guess.