user3068010
user3068010

Reputation: 57

Mysql searching for string in text

I can't help but think my syntax is wrong.

SELECT * FROM  `rework` WHERE rw_pd LIKE 'FIB'

The SQL executes with a result of 0 rows. I KNOW there are rows with that string in that field. Anybody see any stupid mistakes?

Upvotes: 0

Views: 40

Answers (2)

Ende Neu
Ende Neu

Reputation: 15773

You have to specify the wildcard if your have strings which contains FIB chained to other text:

SELECT * FROM  `rework` WHERE rw_pd LIKE '%FIB%'

Check also this link for various wildcards usage.

Upvotes: 2

Jako
Jako

Reputation: 4901

Have you tried adding %, which is a wildcard.

SELECT * FROM rework WHERE rw_pd LIKE '%FIB%'

Upvotes: 1

Related Questions