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
 General SQL Server Forums
 New to SQL Server Programming
 diffrence between inner join and where

Author  Topic 

PharbAct
Starting Member

1 Post

Posted - 2009-08-27 : 05:19:09
hello evrybody i'm new to Sql and in this Forum
i allready know how to work on join queries but can anyone tell me what is the diffrence between those 2 querys ?

1 - Select CT.id,CT.PayMethod,p.* from CashierTransactionDetail CT,Paymethod p where CT.payMethod = p.id

2 - Select CT.id,CT.PayMethod,p.* from CashierTransactionDetail CT inner join Paymethod p on CT.payMethod = p.id

are those queries the same ,and in that case why do we have the inner join statment ?
thank you

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-08-27 : 05:45:07
The first one is call Cartition product.

To know about more see Relational Algebra in http://technet.microsoft.com/en-us/library/cc966426.aspx

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

ahmad.osama
Posting Yak Master

183 Posts

Posted - 2009-08-27 : 06:01:16
quote:
Originally posted by PharbAct

hello evrybody i'm new to Sql and in this Forum
i allready know how to work on join queries but can anyone tell me what is the diffrence between those 2 querys ?

1 - Select CT.id,CT.PayMethod,p.* from CashierTransactionDetail CT,Paymethod p where CT.payMethod = p.id

2 - Select CT.id,CT.PayMethod,p.* from CashierTransactionDetail CT inner join Paymethod p on CT.payMethod = p.id

are those queries the same ,and in that case why do we have the inner join statment ?
thank you



look at the execution plan for both queries...
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-08-27 : 07:00:12
The difference is only the used syntax.
#1 is the old, deprecated way.
#2 is the better way to do this join.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -