Inner join vs=

  • Hie all

    How do i write this t-Sql using join statements only

    SELECT AR.SectionID ,O.OptionScore,AR.QuestionID,AR.SubSectionID

    FROM

    AuditResults AR

    INNER JOIN [Option] OONAR.OptionID = O.OptionID

    WHERE

    AR.SiteAuditID = 4602

    andO.QuestionID = AR.QuestionID ---i need a this to be an inner join under the FROM Clause.

    Order BY AR.SectionID

  • SELECT AR.SectionID ,O.OptionScore,AR.QuestionID,AR.SubSectionID

    FROM

    AuditResults AR

    INNER JOIN [Option] O

    ON AR.OptionID = O.OptionID

    and AR.QuestionID = O.QuestionID

    WHERE

    AR.SiteAuditID = 4602

    Order BY AR.SectionID

    Ie just move the and part from the where clause to the join clause..

    Mike John

  • I DIDNT KNOW THAT,

    Thank you very much.

  • omlac (1/16/2009)


    I DIDNT KNOW THAT,

    Thank you very much.

    yea you have too many things here to know ... that's nice to help each-other!

    You are welcome!

    ============================================================
    SELECT YOUR PROBLEM FROM SSC.com WHERE PROBLEM DESCRIPTION =
    http://www.sqlservercentral.com/articles/Best+Practices/61537/[/url]

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

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