Join fields of own table in Access

0

I'm having a problem that brings me headlong. I have a TELEPHONE table in Access with the columns Prefix_provider and Prefix_client. I need (preferably with sets) to find Provider_Prefixes that are never Client_Prefix. Any ideas? This is what I have tried so far, but I do not know what else to do.

SELECT * 
FROM TELEFONOS INNER JOIN TELEFONOS_2
ON TELEFONOS.Prefijo_proveedor != TELEFONOS_2.Prefijo_cliente;
    
asked by JP Barroso 06.03.2018 в 14:14
source

1 answer

1

What you need then is not an inner join, but a nested select:

SELECT *
FROM TELEFONOS
WHERE Prefijo_Proveedor NOT IN (SELECT DISTINCT Prefijo_Cliente
                                FROM TELEFONOS)

This should show you the expected results.

Greetings.

    
answered by 06.03.2018 / 14:38
source