How to join two tables by multiple columns in SQL?

后端 未结 5 1000
既然无缘
既然无缘 2020-12-29 06:03

I have two tables named Evaluation and Value.

In both tables, there are four columns. But three of the four are the same. In other words, th

5条回答
  •  鱼传尺愫
    2020-12-29 07:04

    You should only need to do a single join:

    SELECT e.Grade, v.Score, e.CaseNum, e.FileNum, e.ActivityNum
    FROM Evaluation e
    INNER JOIN Value v ON e.CaseNum = v.CaseNum AND e.FileNum = v.FileNum AND e.ActivityNum = v.ActivityNum
    

提交回复
热议问题