我有这个查询:
SELECT `gift_donations`.*, `scholarships`.`name` AS scholarship_name
FROM (`gift_donations`)
LEFT
OUTER JOIN `scholarships` scholarships ON `scholarships`.`id` =
`gift_donations`.`scholarship_id`
WHERE `gift_donations`.`contact_id` = '13'
AND
`gift_donations`.`in_memory` REGEXP '[a-zA-Z]+' OR in_honor REGEXP '[a-zA-Z]+'
ORDER BY
`gift_donations`.`id` desc
如您所见,在这里我试图只获取那些记录但问题contact_id
是13
结果集还包含其他contact_id
记录13
为什么会这样,是因为REGEXP
还是我没有按照应有的方式进行查询,只带回那些我想要的contact_id
或13
任何其他数字的记录?