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
asimoesAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
JHausmannConnect With a Mentor Commented:
select * from clients where clientid not in(select distinct clientid from invoices)
0
 
PatriceFCommented:
Select * from Clients left join Invoices on
Clients.ClientID = Invoice.ClientID
where Invoices.ClientID is null
0
 
JHausmannCommented:
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.
0
 
PatriceFCommented:
Sorry, this is my answer as a comment...
Select * from Clients left join Invoices on
Clients.ClientID = Invoice.ClientID
where Invoices.ClientID is null
0
All Courses

From novice to tech pro — start learning today.