Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Joins & sub queries

Author  Topic 

ricky007
Starting Member

4 Posts

Posted - 2007-08-22 : 08:10:43
What is the diffence between joins and queries? When should I go for joins and when should I go for sub queries

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-08-22 : 08:14:10
It depends.
The question is very much like, "should i buy red apples or green apples today?".

It depends on your objective, what you are trying to accomplish with your query.
If many "get last record in a group" query, a correlated subquery will do fine.

When only fetching a column, a join will perform better.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -