|
-
Jan 16th, 2003, 06:50 AM
#1
Thread Starter
Junior Member
difference between Join Opertaor and its equilvalent where Clause used Query
Eg.
Select * from Sales s Join Titles t
On S.titleID = t.TitleID
Join Publishers P
On t.PubId = P.PubId
other Format for the same query
Select * from Sales s,Titles t , Publishers P where s.titleId=t.titleId and t.PubId=P.PubId
Tell me is there any difference between two queries
if yes then which one is efficient Performance wise
-
Jan 16th, 2003, 07:26 AM
#2
Select * from Sales s Join Titles t
On S.titleID = t.TitleID
Join Publishers P
On t.PubId = P.PubId
other Format for the same query
Select * from Sales s,Titles t , Publishers P where s.titleId=t.titleId and t.PubId=P.PubId
Select *
From (Sales Titles Left Join Sales On Titles.TitleID=Sales.titleID)
Left Join Publishers On Titles.PubID=Publishers.PubID
Depends what database you are running as to whether the SQL statements would work, and whether you need inner or outer or other types of joins (see top thread for Sql help).
As to performance, well you'd have to try both on 100,000 entries in each table and see. Shouldn't be much difference between them though (IMO).
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|