Hello ALL,
I want to list every client # that is in the clients table but is not in the contracts table. The purpose is to bring all clients that do not have any contract attached to it and clean the clients table.
clients
client_no surname firstname
1 john smith
2 johny smith1
3 jorge silva
contracts
client_no contract_no price
1 06123101 1000
3 06123001 2000
Is the query below correct ? The result of it does not show any rows (it runs without errors) and I know what the result should be.
SELECT client_no from clients
WHERE client_no NOT IN (select client_no from contracts)
What am I doing wrong ?
THANKS A LOT
I want to list every client # that is in the clients table but is not in the contracts table. The purpose is to bring all clients that do not have any contract attached to it and clean the clients table.
clients
client_no surname firstname
1 john smith
2 johny smith1
3 jorge silva
contracts
client_no contract_no price
1 06123101 1000
3 06123001 2000
Is the query below correct ? The result of it does not show any rows (it runs without errors) and I know what the result should be.
SELECT client_no from clients
WHERE client_no NOT IN (select client_no from contracts)
What am I doing wrong ?
THANKS A LOT