Results 1 to 2 of 2

Thread: difference between Join Opertaor and its equilvalent where Clause used Query

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2002
    Posts
    19

    Question 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

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343
    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

    BOFH Now, BOFH Past, Information on duplicates

    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
  •  



Click Here to Expand Forum to Full Width