Join Syntax.

chattabaughchattabaugh Posts: 12
Our shop is split over the type fo join syntax to use. Some use the old style of:

SELECT ...
FROM Table1, Table2, Table3
WHERE Table1.ID = Table2.T1ID
AND Table2.ID = Table3.T2ID
And some use the ANSI 92 Style of:

SELECT ...
FROM Table1
INNER JOIN Table2 ON Table1.ID = Table2.T1ID
INNER JOIN Table3 ON Table2.ID = Table3.T2ID

In the case of outer joins, we even have some mixed syntax....

FROM Table1, Table2 LEFT JOIN Table3 ON Table2.ID = Table3.T2ID
WHERE Table1.ID = Table2.T1ID

If would be very benificial to be able to reformat to one of the two styles.

Comments

  • Our shop is split over the type fo join syntax to use. Some use the old style of:

    SELECT ...
    FROM Table1, Table2, Table3
    WHERE Table1.ID = Table2.T1ID
    AND Table2.ID = Table3.T2ID
    And some use the ANSI 92 Style of:

    SELECT ...
    FROM Table1
    INNER JOIN Table2 ON Table1.ID = Table2.T1ID
    INNER JOIN Table3 ON Table2.ID = Table3.T2ID

    In the case of outer joins, we even have some mixed syntax....

    FROM Table1, Table2 LEFT JOIN Table3 ON Table2.ID = Table3.T2ID
    WHERE Table1.ID = Table2.T1ID

    If would be very benificial to be able to reformat to one of the two styles.

    Hi,

    this is a very good idea in case of inner joins. I have saved this for consideration in next releases.

    Regards,
    Andras
    András Belokosztolszki, PhD
    Red Gate Software Ltd.
  • We are migrating from SQL svr 2000 to sql svr 2005 and want to refactor non ansi 92 join syntax to ansi 92 complient syntax. Will refactor do this for us ?
Sign In or Register to comment.