Using LIKE with multiple cols

wxdqz

New Member
Hi,
I'm coding a SQL based search engine for a big eCommerce project I'm working on and have the following question (which I was not able to find an answer for).

I am trying to search through two SQL columns in the same LIKE statement, like so:

SELECT product_name, product_year FROM products WHERE product_name OR product_year LIKE "%something%";

This, however, will only search the product_year column and I wondering if it's possible to include both the product_name and product_year column in the search using the same LIKE statement.

Thanks,
Serge
 
Back
Top