|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, May 01, 2013 1:09 AM
Points: 78,
Visits: 197
|
|
Dear Friends,
I am having two tables TB_PERSON_P and TB_PERSON_R both having a common column R_ID now we can write two query:
select R_ID from TB_PERSON_P P,TB_PERSON_R R where P.R_ID=R.R_ID
and
Select R_ID from TB_PERSON_P P join TB_PERSON_R on P.R_ID=R.R_ID
which would be faster among these two statement?
Thanks!!
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 7:38 AM
Points: 283,
Visits: 226
|
|
They will perform the same (same execution plan), the only difference is one uses the ANSI syntax and the other the old style SQL Server / Sybase syntax.
Robert Murphy, Microsoft MCITP (Database Administrator 2008) and MCAD Certified
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, February 22, 2013 7:38 AM
Points: 283,
Visits: 226
|
|
...and I would recommend specifying the join type for readability if using the improved ANSI joins:
INNER JOIN (default) RIGHT OUTER JOIN LEFT OUTER JOIN etc etc
Robert Murphy, Microsoft MCITP (Database Administrator 2008) and MCAD Certified
|
|
|
|