I have two queries run on mysql. The first one returns an error while the seconds one returns an empty set and no error happens.
SELECT CONCAT_WS(',' , firstName, lastName) `Full Name`
FROM employees
WHERE `Full Name` LIKE '%on';
ERROR 1054 (42S22): Unknown column 'Full Name' in 'where clause'
SELECT CONCAT_WS(',' , firstName, lastName) 'Full Name'
FROM employees
WHERE 'Full Name' LIKE '%on';
Empty set (0.00 sec)
Another odd thing about the second query is that it should return some rows ( notice Patterson
)!
Can someone help me explain the difference between these two queries and why the second one doesn't return the correct result?