我需要这个查询来选择 category = logotypes 和 full_text 就像搜索词一样的所有帖子。
SELECT *
FROM posts
WHERE category = :logotypes
AND full_text LIKE CONCAT('%', :term, '%')
ORDER BY post_date DESC
但我希望搜索词也检查是否在标题中完成了任何匹配,例如:
SELECT *
FROM posts
WHERE category = :logotypes
AND full_text LIKE CONCAT('%', :term, '%')
--> ALSO CHECK heading LIKE CONCAT('%', :term, '%')
ORDER BY post_date DESC
我该怎么办?
PS该类别应始终保留。它仍然必须是category = :logotypes