I'm trying to create little search engine for only a small database.
"CONCAT () AS name" does not work so how can I use something like Concat() as xxx ?
What I try to do is
SELECT
CONCAT(names,' ',office) AS bigDataField
FROM item_table
WHERE bigDataField LIKE "%jessy%";
What is the best way to use the concat field?
解决方案
You could use the HAVING clause, rather than duplicating the CONCAT() function in your WHERE clause.
For example:
SELECT CONCAT(`names`,' ',`office`) `bigDataField`
FROM `item_table`
HAVING `bigDataField` LIKE "%jessy%";