问题
why does my sintax is not right?
SELECT *,
MATCH(tags,title,description) AGAINST ('asd jhbdckdsb' IN BOOLEAN MODE) AS score
FROM blogs WHERE score > 0
ORDER BY score DESC, insert_datetime DESC, id DESC ;
the problem seems to be on WHERE condition :/
回答1:
invisible columns and column alias are not allowed in WHERE
so use HAVING
HAVING score > 0
instead of WHERE
回答2:
You cannot use a column alias in the WHERE clause. You must repeat the MATCH a second time.
来源:https://stackoverflow.com/questions/12430516/mysql-query-match-with-alias-where-not-working