下面是两个查询。我在 Access 中得到正确的返回,但在 SQL 中没有返回。我在 SQL 版本中的语法是否错误?奇怪的是,即使我省略了 WHERE 语句的第二部分,返回的值也没有意义(即姓氏 = tblx.Last Name = Hull / tbly.Last Name = Morris)...有什么想法吗?
--SQL 2005
SELECT tblx.[Last Name], tblx.[First Name] FROM tblx cross join tbly WHERE (tblx.[Last Name] Like '%[tbly].[Last Name]%') AND (tblx.[First Name] Like '%Right([tbly].[First Name],3) %')
--访问2007
SELECT tblx.[Last Name], tblx.[First Name] FROM tblx cross join tbly WHERE (((tblx.[Last Name]) Like " " & [tbly].[Last Name] & " ") AND ((tblx .[First Name]) Like " " & Right([tbly].[First Name],3) & " "))