案例1(如果我有2个字)
我想要的是,如果我输入三星电视,那么我想要TV
或Samsung TV
但不是来自Samsung refrigerator
或Samsung fridge
的产品。我试过的是
select * from tabel name where title like "%Samsung TV%" or title like "%Samsung" or title like "%TV"
案例1问题
它还从三星冰箱和三星冰箱
中选择产品案例2(当字数超过2时)
答案 0 :(得分:0)
更好地使用just和
select * from tabel name where title like "%TV" or (title like "%Samsung%" and title like "%TV%")
答案 1 :(得分:0)
您可以尝试这样的事情: -
select * from department where Name like "%Samsung" or (Name like "%Tv%" and Name like "%Samsung%") UNION select from department where Name like "%tv" or (Name like "%Samsung%" and Name like "%TV%")
希望这会有所帮助