"mysql query select where id does not exist in the join table" Code Answer

4

you can find all locations that member 2371 is in by doing:

select location 
from memberlocation
where memberid = 2371

you can find all other locations (the ones you want) by:

select * 
from location 
where locationid not in 
    ( select location 
      from memberlocation
      where memberid = 2371)
By Andrey Tserkus on May 19 2022

Answers related to “mysql query select where id does not exist in the join table”

Only authorized users can answer the Search term. Please sign in first, or register a free account.