[2
使用SQL Table Joins 从多个列中检索数据
方法,突出显示其使用并解决Microsoft Access的特定注意事项。 [2 基于共享列值从两个或多个表中合并行。 结果表仅包含所有连接表中匹配的行。 我们的示例涉及
tbl_facilitatorClasses以显示类名称和协助详细信息(主要和次要)。
这是使用
的SQL查询:
选择
tbl_facilitatorclasses.classname,
tbl_facilitators.facillname作为主要facilitatorlname,
tbl_facilitators.facilfname作为主要facilitatorfname,
tbl_facilitatorClasses.secondfacil,
tbl_facilitators.facillname作为SecondaryFacilitatorLname,
tbl_facilitators.facilfname作为SecondaryFacilitatorFname
从
tbl_facilitatorClasses
内联
tbl_facilitators on tbl_facilitatorclasses.primefacil = tbl_facilitators.facilid
内联
tbl_facilitators在tbl_facilitatorClasses.secondfacil = Secondaryfacilitator.facilid; 语句,将每个加入封闭在括号中以确保正确的执行顺序至关重要。 上面的示例使用括号以确保清晰并防止潜在的错误。
[2
联合垂直组合来自多个表或子征服的数据,它不适合这种情况。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3