1

エラーが発生したコードは次のとおりです。

FROM
    IndexPID
    INNER JOIN Demographics ON
        IndexPID.NDoc_Number = Demographics.NDoc_Number,
    PatientSupply
    INNER JOIN Demographics ON
        PatientSupply.NDocNum = Demographics.NDoc_Number

私もこの方法で試しました:

FROM
    IndexPID, PatientSupply
    INNER JOIN Demographics ON
        IndexPID.NDoc_Number = Demographics.NDoc_Number
    INNER JOIN Demographics ON
        PatientSupply.NDocNum = Demographics.NDoc_Number

しかし、葉巻はありません。誰かが私が間違っていることを教えてくれますか?

4

4 に答える 4

4

SQL全体を投稿すると簡単になります!

試す

FROM
IndexPID
INNER JOIN Demographics ON
    IndexPID.NDoc_Number = Demographics.NDoc_Number
INNER JOIN PatientSupply ON
    PatientSupply.NDocNum = Demographics.NDoc_Number
于 2012-08-20T20:22:08.863 に答える
4

You were very close:

FROM IndexPID
INNER JOIN Demographics 
   ON IndexPID.NDoc_Number = Demographics.NDoc_Number
INNER JOIN PatientSupply
   ON Demographics.NDoc_Number = PatientSupply.NDocNum
于 2012-08-20T20:22:30.507 に答える
2

ここでは、暗黙的 (カンマ区切り) と明示的なJOINs を奇妙な方法で混合しています。明示的な s のみを使用し、テーブル名または句INNER JOINの間にコンマを入れずに、次のようになります。ON

FROM
  IndexPID
  INNER JOIN Demographics 
    ON IndexPID.Ndoc_Number = Demographics.NDoc_Number
  INNER JOIN PatientSupply 
    ON PatientSupply.NDocNum = Demographics.NDoc_Number
于 2012-08-20T20:22:01.147 に答える
1

内部結合を使用するため、次を使用できます。

FROM Demographics
inner join IndexPID on Demographics.NDoc_Number=IndexPID.NDoc_Number
inner join PatientSupply on Demographics.NDoc_Number=PatientSupply.NDocNum
于 2012-08-20T20:30:09.263 に答える