1

我是新手,我无法让这个查询返回任何结果。如何添加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。汉斯

4

1 回答 1

0

您可以在 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
于 2012-05-01T12:27:21.950 回答