开发者

MySQL MATCH for more than one field

开发者 https://www.devze.com 2023-04-11 01:05 出处:网络
SELECT * FROMportfolio INNER JOINtranslation ON portfolio.description =translation.key WHERE MATCH(it_translation.*) AGAINST(\'test\')
SELECT * FROM  portfolio
INNER JOIN  translation 
ON portfolio.description =  translation.key
WHERE
  MATCH(it_translation.*) AGAINST('test')

Why this code doesn't work?

If I do like this MATCH(it_translation.field) AGAINST('test') everything is ok, but I wanna search 开发者_StackOverflow中文版FULLTEXT via more than one field, and I don't know how many fields in table.


IIRC for FULLTEXT to work you need a FULLTEXT index that covers every field you want to use it for, so if you "don't know how many fields in table" you won't be able to MATCH it like that.

0

精彩评论

暂无评论...
验证码 换一张
取 消