我正试图让 MySQL 将所有在某个时间没有预订的讲师归还给我。此查询本质上是搜索查询。因此,返回所有基本上尚未预订的教练及其详细信息。有人可以帮我完成它吗?
SELECT
AddressTypes.AddressTypeName,
Addresses.*,
InstructorSettings.*,
Users.*,
BookedSlots.DateTime
FROM Users
LEFT OUTER JOIN InstructorSettings
ON Users.UserID = InstructorSettings.UserID
LEFT OUTER JOIN Addresses
ON Users.UserID = Addresses.UserID
INNER JOIN AddressTypes
ON Addresses.AddressTypeID = AddressTypes.AddressTypeID
LEFT OUTER JOIN BookedSlots
ON Users.UserID = BookedSlots.UserID
WHERE Users.AccountTYpe = 3 AND Addresses.PostCode1 IN ('l13') AND BookedSlots.DateTime <> '2013-04-25 11:00:00'
上面的查询没有返回任何内容,但如果我取出“AND BookedSlots.DateTime <> '2013-04-25 11:00:00'”,它会返回所有讲师的详细信息。
数据库