MySQL - Search exact word from string
Try using regular expressions:
SELECT
*
FROM
`table`
WHERE
Description regexp '(^|[[:space:]])pen([[:space:]]|$)';
Demo
Or using word boundaries:
SELECT
*
FROM
`table`
WHERE
Description regexp '[[:<:]]pen[[:>:]]';
You can use REGEXP
and the [[:<:]]
and [[:>:]]
word boundary markers:
SELECT
*
FROM
`table`
WHERE
Description REGEXP '[[:<:]]pen[[:>:]]';
SQL Fiddle Demo