The following query returns NO data:
select * from ediImport
WHERE glnfact NOT IN (select GLN from Clients)
After some search, I found the data I want, this way:
select * from ediImport
WHERE glnfact NOT IN (select GLN from Clients WHERE gln is not null)
But I feel like the first query SHOULD return the information (and I think it WOULD return it in Access).
So my questions:
- why is first query not working
- is there a better, more efficient way to do this ? I found EXISTS and ANY but I can't see any advantage over the old school way.
Note: I don't want to use a left join here since my REAL need is to perform an UPDATE:
UPDATE ediImport SET Status = 2
WHERE glnfact NOT IN (select GLN from Clients WHERE gln is not null)