是否可以扩展此查询
SELECT id, name, MATCH (name) AGAINST (%s)
AS score FROM mydb.authors WHERE MATCH (name) AGAINST (%s)
跟随一个?
SELECT authors.id, papers.id FROM `mydb`.`auth2paper`
JOIN `mydb`.`papers` ON `mydb`.`auth2paper`.paper_id = `mydb`.`papers`.id
JOIN `mydb`.`authors` ON `mydb`.`auth2paper`.auth_id = `mydb`.`authors`.id
最佳答案
没有理由不这样做。只需像平常一样在WHERE中使用MATCH。
SELECT authors.id, papers.id, MATCH (`mydb`.`authors`.name) AGAINST (%s) Score
FROM `mydb`.`auth2paper`
JOIN `mydb`.`papers` ON `mydb`.`auth2paper`.paper_id = `mydb`.`papers`.id
JOIN `mydb`.`authors` ON `mydb`.`auth2paper`.auth_id = `mydb`.`authors`.id
WHERE MATCH (`mydb`.`authors`.name) AGAINST (%s)
关于mysql - 在MySQL中将MATCH AGAINST与JOINO混合,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5488726/