2012-08-01 106 views
0

我该如何编写一个mySQL查询,我正在寻找使用LIKE运算符的东西,而不是等于什么样?mySQL LIKE运算符不等于

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

回答

8

NOT LIKE

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

,或者,如果我误解了你的意图,你可能想:

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

感谢的是,ctrahey。它工作(第一个) – StealthRT 2012-08-01 17:04:37