what about left join :
SELECT u.Id ... FROM users u LEFT JOIN employees e ON u.Id = e.user_id WHERE e.user_id IS NULL
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
For a one-to-one relationship, how do you query only the records without a match? I see that in MySQL you can't use EXCEPT. I also tried looking at the various joins.
Users Table: id name
Employees Table: user_id
I only want the results from the users table that are not linked to the employees table.
what about left join :
SELECT u.Id ... FROM users u LEFT JOIN employees e ON u.Id = e.user_id WHERE e.user_id IS NULL
Please or to participate in this conversation.