baik
baik

Reputation: 1013

Multiple like on same field

is it possible to do something like the following in MySQL: SELECT * FROM table WHERE value LIKE '%A%' AND value LIKE '%B%'

I am trying to catch entries where "value" would be "AxBx".

Thank you for some advice!

Upvotes: 2

Views: 215

Answers (1)

Marcus
Marcus

Reputation: 12586

You can use several wildcards % in the same LIKE. For example:

SELECT * FROM table WHERE value LIKE 'A%B%'

Upvotes: 3

Related Questions