MS Access:加入三个有条件的表

时间:2018-04-13 09:06:26

标签: ms-access join

在MS Access数据库中,我尝试在三个有条件的表上进行连接。

我目前的做法不起作用:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<div class="et_pb_column et_pb_column_1_4  et_pb_column_2 et_pb_css_mix_blend_mode_passthrough">



  <div id="treatmentlink" class="et_pb_promo et_pb_module et_pb_bg_layout_dark et_pb_text_align_center verticalcenter all-link et_pb_cta_0" style="background-color: #dfa926;">
    <div class="et_pb_promo_description">
      <h2 class="et_pb_module_header">YOGA CLASSES</h2>
      <p>Choose from a wide selection of courses to suit most tastes, abilities and ages</p>
    </div>
    <div class="et_pb_button_wrapper"><a class="et_pb_promo_button et_pb_button" href="/kundalini-yoga-south-devon">click here</a></div>
  </div>

  <div id="treatmentlink" class="et_pb_promo et_pb_module et_pb_bg_layout_dark et_pb_text_align_center verticalcenter all-link et_pb_cta_1" style="background-color: #dfa926;">
    <div class="et_pb_promo_description">
      <h2 class="et_pb_module_header">Other CLASS</h2>
      <p>Choose from a wide selection of courses to suit most tastes, abilities and ages</p>
    </div>
    <div class="et_pb_button_wrapper"><a class="et_pb_promo_button et_pb_button" href="/kundalini-yoga-north-devon">click here</a></div>
  </div>

因为表P中没有表A中相应条目的数据集(条件:A。[NUMMER] = VAL(P。[PLUX]))不会被返回。

我尝试了一种JOIN方法但我找不到合适的语法。

1 个答案:

答案 0 :(得分:0)

谢谢@Gustav GUI设计师帮助(甚至不知道它存在 - 到目前为止只使用了SQL)。

SELECT P.ColumnX, A.ColumnY, R.ColumnZ
FROM (P LEFT OUTER JOIN A.[NUMBER]) = VAL(P.[PLUX]))
INNER JOIN R ON P.[PRGUID] = R.[RGUID]
WHERE R.[TIMEST] > #yyyy-MM-dd HH:mm:ss# 
AND  R.[TIMEST] < #yyyy-MM-dd HH:mm:ss#