I need to combine 2 columns and find whether the combined content matches something. However the following query doesn’t work:
select
concat(column1,column2) as combined_column
from
my_table
where
combined_column like '%value%';
MySQL reports an error that ‘combined_column’ doesn’t exist. How to solve this problem?
You should replace your where clausole with this one:
Explanation: The where clausole isn’t able to read the var named in the
SELECT.