asimoes
asked on
SQL to retrieve data
Hello
I have two tables related by common field.
1ª table-Clients
2º table-invoices
common field->clientID
In SQL, how can I retrieve clients from the first table that have not invoices in the second table.
I'm working with VB 6.0
Thanks
I have two tables related by common field.
1ª table-Clients
2º table-invoices
common field->clientID
In SQL, how can I retrieve clients from the first table that have not invoices in the second table.
I'm working with VB 6.0
Thanks
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I realize you're new Patrice so I hope that I don't sound too harsh. When someone posts a comment in this group (and not all of the groups work the same way, you're just going to have to learn which ones do/don't over time), you should also post a comment. You then leave it up to the person who posed the question to decide which answer best suits his/her needs.
As it stands now, because you "answered" the question, you will default to getting the points if the person that answered the question does not accept your answer after a certain period of time.
Welcome to Expert Exchange, BTW.
As it stands now, because you "answered" the question, you will default to getting the points if the person that answered the question does not accept your answer after a certain period of time.
Welcome to Expert Exchange, BTW.
Sorry, this is my answer as a comment...
Select * from Clients left join Invoices on
Clients.ClientID = Invoice.ClientID
where Invoices.ClientID is null
Select * from Clients left join Invoices on
Clients.ClientID = Invoice.ClientID
where Invoices.ClientID is null
Clients.ClientID = Invoice.ClientID
where Invoices.ClientID is null