AND addresses.id_address NOT IN (
SELECT id_address FROM clients_addresses WHERE id_address = addresses.id_address
)
AND clients_addresses.id_address IS NULL
SELECT
a.*,
accounts.id_account,
accounts.name as name_account,
clients_addresses.id_client as on_client,
clients.name
FROM
(SELECT
*
FROM addresses
WHERE id_project = 10
AND id_account = 65
) a
LEFT JOIN ....