Click here to Skip to main content
15,889,315 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please review and give the most appropriate select statement to compare
2 tables for records not existing

ms sql server compare 2 tables for records not existing


Please provide the fastest select statement .

Thanks

What I have tried:

SQL
SELECT a.name 
FROM a
WHERE a.joint_id NOT IN ( SELECT b.joint_id
FROM b 
)
Posted
Updated 13-Mar-18 7:40am
v2

1 solution

That's the most efficient. See here: NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900