Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建如下查询
SELECT CONCAT(u.firstName," ",u.lastName) as user
然后稍后在我写的查询中:
WHERE user LIKE '%jay%'
我没有得到任何结果。您不能以这种方式使用连接字段吗?
SELECT CONCAT(u.firstName," ",u.lastName) as user ... WHERE user LIKE '%jay%'
不会工作,但是
SELECT CONCAT(u.firstName," ",u.lastName) as user ... HAVING user LIKE '%jay%'
将起作用,就像HAVING对查询结果起作用一样,而WHERE不起作用。
HAVING
WHERE