由于存在=*(RIGHT OUTER JOIN)运算符,因此SQL Server 2012出现了问题。

谁能告诉我以下在SQL Server 2008上正常运行的SQL的SQL Server 2012正确语法是什么?

  SELECT
    ProcessCode,
    ProcessDesc,
    DisciplineDesc,
    ValidProcessName .DisciplineCode
 FROM
    ValidName, ValidProcessName
 WHERE
    ValidProcessName.DisciplineCode =* ValidName.DisciplineCode
 ORDER BY
    ProcessCode

最佳答案

它是:

SELECT

   ProcessCode,
   ProcessDesc,
   DisciplineDesc,
   ValidProcessDiscipline.DisciplineCode

FROM

   ValidProcess RIGHT OUTER JOIN ValidProcessDiscipline

ON

   ValidProcessDiscipline.DisciplineCode = ValidProcess.DisciplineCode

ORDER BY

   ProcessCode

10-02 01:27