Ms access 访问联接表
Access 2007:我们需要一个查询来链接两个表,而不使用唯一字段。两个表都有一个名为“section”的字段,该字段始终为三个数字 像这个例子: (表A-截面=101、208、411…)和(表B-截面=901、304、208…) 此脚本返回一个错误,即 多值字段TableB.Section在指定的JOIN子句中无效Ms access 访问联接表,ms-access,join,Ms Access,Join,Access 2007:我们需要一个查询来链接两个表,而不使用唯一字段。两个表都有一个名为“section”的字段,该字段始终为三个数字 像这个例子: (表A-截面=101、208、411…)和(表B-截面=901、304、208…) 此脚本返回一个错误,即 多值字段TableB.Section在指定的JOIN子句中无效 如果希望所有节字段保持完整,则应执行以下操作: SELECT TableA.section AS tableAsection, TableB.section A
如果希望所有节字段保持完整,则应执行以下操作:
SELECT TableA.section AS tableAsection,
TableB.section AS tableBsection
FROM TableA
INNER JOIN TableB
ON TableA.Section.Value = TableB.Section.Value;
您还可以将节的每个多部分拆分为单独的字段,如下所示:
SELECT TableA.section.Value AS tableAsection,
TableB.section.Value AS tableBsection
FROM TableA
INNER JOIN TableB
ON TableA.Section.Value = TableB.Section.Value;
SELECT TableA.section.Value AS tableAsection,
TableB.section.Value AS tableBsection
FROM TableA
INNER JOIN TableB
ON TableA.Section.Value = TableB.Section.Value;