下午好,
MS Access SQL中是否可以首先尝试匹配的左连接,如果没有匹配则可以使用like / contains join?
目前我喜欢的加入看起来像这样
SELECT
[tbl_Area_lkup].[Area],
[tbl_Area_lkup].[Sub Area],
[tbl_Area_lkup].[PageTrimmed] AS [Page lkup],
qry_AdviserPages_Step1.PageTrimmed AS [Trimmed Page],
qry_AdviserPages_Step1.Page AS Page,
qry_AdviserPages_Step1.Date, IIf([tbl_Medium_lkup].[mediumgrp] Is Null,"CHECK",[tbl_Medium_lkup].[mediumgrp]) AS Medium,
qry_AdviserPages_Step1.Hostname,
qry_AdviserPages_Step1.Users,
qry_AdviserPages_Step1.Sessions,
qry_AdviserPages_Step1.Pageviews
FROM (qry_AdviserPages_Step1
LEFT JOIN tbl_Area_lkup ON [qry_AdviserPages_Step1].[PageTrimmed] Like '*' & [tbl_Area_lkup].[PageTrimmed] & '*')
LEFT JOIN tbl_Medium_lkup ON qry_AdviserPages_Step1.Medium = tbl_Medium_lkup.Medium
ORDER BY 2;
我想要做的是=在同一列上加入=但如果没有匹配则执行上述连接。
任何指针都会很棒。
感谢。