为什么在此 SQL 查询期间得到空白返回


SELECT dependents.[Dependent_name], 
       "Child of " + employee.[Lname] + "," + employee.[Fname] AS Dependence
FROM dependents, employees AS employee
WHERE employee.[Lname] LIKE 'W%' 
  AND employee.Ssn = dependents.Essn 
  AND NOT dependents.Relationship = "Spouse"
ORDER BY employee.[Lname], dependents.[Dependent_name];

我正在尝试创建一个查询,该查询将返回一个包含 2 个字段的表。那些是dependent_name和依赖。唯一无法正常运行的是 LIKE 条件,我不知道为什么。它会导致整个表不返回任何内容。它应该返回 2 个条目

MS

Access 在 LIKE 中使用 * 作为通配符,而不是%。 因此,请尝试以下WHERE条件:

WHERE employee.[Lname] LIKE 'W*' AND
      . . . 

最新更新