I have got 2 tables:
users (user-id, user-name)
devices (device-id, user-id, device-name)
Both tables are linked via the foreign key user-id in the table devices.
One user can have n devices or NO device.
I am looking for those users who do NOT have a device.
In other words, users for whom there is NO user-id in the devices table.
What is the SQL statement?
The opposide works fine:
SELECT users.user-name, devices.device-name
FROM users,devices WHERE users.user-id=devices.user-id;