Get devices with not driver assigned I have this related tables:



And I need to get those devices with no driver assigned, in other words the device returned on this query shouldn't be on driver_has_device table since it'll not have driver assigned, can any give me some help on this query?
In SQL Server, I would write the following query:

SELECT *
FROM dbo.driver d
    LEFT JOIN dbo.driver_has_device dhd ON d.id = dhd.driver_id
WHERE dhd.driver_id IS NULL;


Essentially, this returns all rows from drivers that do not have a corresponding row in driver_has_device.