mysql CONCAT()AS名称? [英] mysql CONCAT () AS name?
本文介绍了mysql CONCAT()AS名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正试图为一个小型数据库创建一个小的搜索引擎. "CONCAT()AS名称"不起作用,因此如何使用类似Concat()的名称作为xxx?
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 ?
在此处创建示例 http://sqlfiddle.com/#!2/21b5c/5
我想做的是
SELECT
CONCAT(names,' ',office) AS bigDataField
FROM item_table
WHERE bigDataField LIKE "%jessy%";
使用concat字段的最佳方法是什么?
What is the best way to use the concat field?
推荐答案
您可以使用HAVING
子句,而不是在WHERE
子句中复制CONCAT()
函数.
You could use the HAVING
clause, rather than duplicating the CONCAT()
function in your WHERE
clause.
例如:
SELECT CONCAT(`names`,' ',`office`) `bigDataField`
FROM `item_table`
HAVING `bigDataField` LIKE "%jessy%";
这篇关于mysql CONCAT()AS名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文