Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
1).Difference between join and subquries in sq server?
2).join and subquires will give same reslut set?
if possible tell me how?
Posted

You can find plenty of discussions on the web. Check out these two:
1. join-and-sub-query[^]
2. SQL Joins and Subqueries[^]
 
Share this answer
 
You should consider buying a book on SQL, or using Google. Your question is basic, top level, and very difficult to answer fully in a forum reply.

In short, a sub query means the same query has to run for every row in the main query. A join runs once and then joins. It's faster, and more efficient. There's always a lot of ways to get the same result in SQL, what you're talking about is a question of better processes, not different results.
 
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