V
V
Vadim Leven2014-04-27 08:12:34
SQL
Vadim Leven, 2014-04-27 08:12:34

SQL: Why doesn't Where see the new column?

Hello. I have code:

SELECT CONCAT_WS(' ', first_name, last_name) AS name_user
FROM users_info
WHERE (name_user LIKE '%а%')

I also have an error in this code. Error: "#1054 - Unknown column 'name_user' in 'where clause'"
Q: Why doesn't Where see the new column? How to fix? Or how to do it differently?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2014-04-27
@levenwadim

HAVING instead of WHERE should help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question