Page 1 of 1

"LIKE" command of mysql for searching?

Posted: Thu Apr 22, 2010 12:49 am
by rahulephp
Hi there,
Could you please help me to find-out the solution?
I need to use "LIKE" command of mysql.

Below are title from a Product table. If i search for "Alarm" then it should show me result only for title which has word alarm. (0th and 2nd only)

table_name = product
Column_name = title
0 ->Casio G-Shock Velocity Indicator Alarm watch
1 ->Seiko Velatura Tachymeter Chronograph watch
2 ->Citizen promaster Alarm perpetual watch


Thank you in anticipation

Re: "LIKE" command of mysql for searching?

Posted: Thu Apr 22, 2010 2:50 am
by Christopher
% is the wildcard character form LIKE, so:

SELECT title FROM product WHERE title LIKE '%Alarm%';