Do you just want to search on word boundaries? If so a crude version might be:
SELECT * FROM products WHERE product_name LIKE "% foo %";
Or you could be a bit cleverer and look for word boundaries with the following REGEXP
SELECT * FROM products WHERE product_name RLIKE "[[:<:]]foo[[:>:]]";
Related Contents:
- SQL query return data from multiple tables
- quick selection of a random row from a large table in mysql
- How can I search (case-insensitive) in a column using LIKE wildcard?
- MySQL SELECT only not null values
- Ordering by specific field value first
- SELECT / GROUP BY – segments of time (10 seconds, 30 seconds, etc)
- MySQL Like multiple values
- Syntax error when using except in a query
- MySQL SELECT LIKE or REGEXP to match multiple words in one record
- SELECT query return 1 row from each group
- Checking multiple columns for one value
- MySQL INNER JOIN select only one row from second table
- MySQL #1093 – You can’t specify target table ‘giveaways’ for update in FROM clause
- SQL query to check if a name begins and ends with a vowel
- Mysql: Order by like?
- MySQL Select Query – Get only first 10 characters of a value
- MySQL INSERT INTO … VALUES and SELECT
- How to select one row randomly taking into account a weight?
- quick selection of a random row from a large table in mysql
- Compare only day and month with date field in mysql
- How to SELECT by MAX(date)?
- Count the number of occurrences of a string in a VARCHAR field?
- MySQL – Get row number on select
- Using column alias in WHERE clause of MySQL query produces an error
- How can I tell when a MySQL table was last updated?
- Return default result for IN value regardless
- How to find similar results and sort by similarity?
- mysql select dynamic row values as column names, another column as value
- Operand Should Contain 1 Column – MySQL NOT IN
- MySQL DELETE FROM with subquery as condition
- How to speed up SELECT .. LIKE queries in MySQL on multiple columns?
- Can a foreign key reference a non-unique index?
- How do I decide when to use right joins/left joins or inner joins Or how to determine which table is on which side?
- How do I use properly CASE..WHEN in MySQL
- How do I use on delete cascade in mysql?
- MySQL variable format for a “NOT IN” list of values
- MySQL Group By and Sum total value of other column
- Sort by order of values in a select statement “in” clause in mysql
- Select TOP X (or bottom) percent for numeric values in MySQL
- Mysql Improve Search Performance with wildcards (%%)
- How to insert data to MySQL with auto-incremented column(field)?
- Is there any reason to worry about the column order in a table?
- Does Order of Fields of Multi-Column Index in MySQL Matter
- limiting the rows to where the sum a column equals a certain value in MySQL
- How to get the count of each distinct value in a column? [duplicate]
- MySQL Inner Join Query Multiple Tables
- MYSQL select DISTINCT values in two columns
- FIND_IN_SET with multiple value [duplicate]
- Are SELECT type queries the only type that can be nested?
- Store mysql query output into a shell variable