Table select statement performance

  • 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!!

  • 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
  • ...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

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply