3个表上的内部联接不起作用

时间:2016-12-11 19:09:18

标签: mysql inner-join access

我有以下数据表(请参阅附图)。 image 我正在尝试使用超过2个表的内连接执行查询。以下是我的询问,请让我知道我在做错的地方。 我正在使用MS-Access。

SELECT Employees.Namee,WeekDay.DayName,Schedule.StartTime,Schedule.Hours FROM Schedule  INNER JOIN Employees ON Schedule.Emp_ID = Employees.ID  INNER JOIN  WeekDay ON Schedule.Weekday = WeekDay.ID;

2 个答案:

答案 0 :(得分:0)

请尝试以下代码

<div id="questions" class="hidden scoped-block">
  <h1>Question <span id="currentQuestion"></span></h1>
  <span id="question"><select id="optSelect"></select></span>
  <div>
    <a href="#">Restart quiz</a> - 
    <a href="#" id="nextQuestion">Next question</a>
  </div>
</div>
<div id="results" class="hidden scoped-block">
  <h1>results</h1>
  <a href="#/">Restart quiz</a>
</div>
<div id="startPage" class="scoped-block">
  <h1>Welcome to a small quiz</h1>
  <p>
  When you completed the quiz, you will be send to <a href="#/results">this</a> results page, which shouldn't be accessible before hand.
  </p>
  <p>
  To start the quiz, click <a href="#/q=0">here</a>
  </p>
</div>

答案 1 :(得分:0)

当您有多个联接时,您需要括号。试试这个

SELECT Employees.Namee,WeekDay.DayName,Schedule.StartTime,Schedule.Hours FROM
(Schedule  INNER JOIN Employees ON Schedule.Emp_ID = Employees.ID)  INNER JOIN  
 WeekDay ON Schedule.Weekday = WeekDay.ID;