Link to home
Start Free TrialLog in
Avatar of James Elliott
James ElliottFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Exclusive Join

Hi All,

I'm looking for the most efficient way of getting an exclusive dataset.

I have circa 3m invoices in a table each with a client ID, and I have a list of 10k client IDs. I want the invoices that do not relate to the client IDs in the list.

For much smaller tasks I would do a 'WHERE ID NOT IN (SELECT ID FROM....)' etc. but I'm aware of this being a poor approach.

Thanks in advance.

Rgds
SOLUTION
Avatar of Haris Dulic
Haris Dulic
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of James Elliott

ASKER

Thanks all. Really helpful. Second & Third solutions appear quickest, especially with indexing the two columns.

Rgds