2012-08-01 661 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