MS Access 2007 查询未返回结果
我使用以下查询来查找来自医学系的客户:
SELECT client.clientID, client.firstname, client.lastname, client.organization,
client.department, client.email, events.Date, events.title,
eventAttendance.eventID, eventAttendance.clientID,
eventAttendance.attended
FROM client INNER JOIN
(events INNER JOIN eventAttendance ON events.id = eventAttendance.ID)
ON client.clientID = eventAttendance.clientID
WHERE client.organization like '%medicine'
在表中,可能的选项是“医学院”和“医学系”;但是,没有返回任何记录。我缺少什么?
谢谢。
I am using the following query to find client who are from the medicine department:
SELECT client.clientID, client.firstname, client.lastname, client.organization,
client.department, client.email, events.Date, events.title,
eventAttendance.eventID, eventAttendance.clientID,
eventAttendance.attended
FROM client INNER JOIN
(events INNER JOIN eventAttendance ON events.id = eventAttendance.ID)
ON client.clientID = eventAttendance.clientID
WHERE client.organization like '%medicine'
In the table, the possibilities are "School of Medicine" and "Department of Medicine;" however, no records are returned. What am I missing?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Access 中的通配符是 * 而不是 %
更改您的 sql,如下所示:
The wild card character in Access is a * not an %
change your sql like so:
我认为您可能并不总是有活动,因此您需要 LEFT JOIN:
I think it is likely that you do not always have an event, so you need LEFT JOIN: