我是新手,无法获取此查询返回任何结果。
如何在下面的查询中添加AND paginas_taal = 'ned'
有人知道吗?

SELECT *
FROM (
  SELECT paginas_tekst AS Tekst, paginas_naam AS Naam, paginas_button AS Button, 'paginas' AS Tabel, '0' AS Parent,
  MATCH (
    paginas_tekst
  )
  AGAINST (
    'shoppers'
  ) AS Relevance
  FROM paginas
  WHERE MATCH (
    paginas_tekst
  )
  AGAINST (
    '+shoppers'
    IN BOOLEAN
    MODE
  )
  HAVING Relevance > 0.2
) AS testtabel
ORDER BY Relevance DESC
LIMIT 0, 30


TIA
Gr。汉斯

最佳答案

您可以在WHERE子句中的任何位置添加额外的AND子句。另请注意,您不需要外部查询,因此您应该能够写

SELECT paginas_tekst AS Tekst, paginas_naam AS Naam, paginas_button AS Button,
    'paginas' AS Tabel, '0' AS Parent,
    MATCH ( paginas_tekst ) AGAINST ( 'shoppers' ) AS Relevance
FROM paginas
WHERE MATCH ( paginas_tekst ) AGAINST ( '+shoppers' IN BOOLEAN MODE )
  AND paginas_taal = 'ned'
HAVING Relevance > 0.2
ORDER BY Relevance DESC
LIMIT 0, 30

10-04 10:21