StealthRT
StealthRT

Reputation: 10542

mySQL LIKE operator that does not equal

How can i write a mySQL query where i am looking for something using the LIKE operator and NOT equaling what is LIKE?

select * from ets_fi where name like '%barcode&' <> '%barcode%';

Upvotes: 1

Views: 8358

Answers (1)

Chris Trahey
Chris Trahey

Reputation: 18290

NOT LIKE

select * from ets_fi where name NOT LIKE '%barcode%';

OR, if I misunderstood your intention, you may want:

select * from ets_fi where name LIKE '%barcode%' AND name != 'barcode';

Upvotes: 10

Related Questions