Q:

How to do a LIKE considering two columns? 

I have a customer table with two columns first_name and last_name. 
How can I use LIKE in a query being able to get data from both columns at same tame? 
For instance:
SELECT CONCAT(first_name, ' ', last_name) as 'full_name' 
FROM customer WHERE full_name LIKE 'John D%'

I've tried this and it tells me full_name column doesn't exist. 

A:

SELECT CONCAT(first_name, ' ', last_name) as 'full_name' 
FROM customer WHERE CONCAT(first_name, ' ', last_name) LIKE 'John D%'

A:

You are almost there
SELECT * 
FROM customer 
WHERE CONCAT(first_name, ' ', last_name) LIKE 'John D%'

Note: this may not have very good performance.  You might want to consider full text search. 

A:

Use HAVING instead of WHERE:
SELECT CONCAT(first_name, ' ', last_name) as 'full_name' 
   FROM customer HAVING full_name LIKE 'John D%'

