为什么当我添加and
到此查询以按标记字符串进行过滤时,我没有得到任何结果。我如何包括这个:
`subject_tags`.`string_en` = '%beach%'"
适当地?
SELECT *, ( 3959 * acos( cos( radians(22.2863943) ) * cos( radians( lat ) ) * cos( radians( subject.long ) - radians(114.1491375) ) + sin( radians(22.2863943) ) * sin( radians( lat ) ) ) )
AS distance
FROM subject
JOIN `subject_to_tag` ON `subject_to_tag`.`subject_id` = `subject`.`id`
JOIN `subject_tags` ON `subject_tags`.`id` = `subject_to_tag`.`tag_id`
and `subject_tags`.`string_en` = '%beach%'
LIMIT 10
这是表结构......
谢谢