[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