我在 mysql 中进行查询,但我有一个问题:这是我的列结构
|country|
--------
Boston
--------
Chicago
--------
washington
问题是我可能有一个搜索项,例如:
North Washington
Boston Easht
South Chicago
所以我试图使用 %like% 操作符来匹配它:
select * from am_ciudad where Ciu_Nombre LIKE '%NORTH BOSTON';
select * from am_ciudad where Ciu_Nombre LIKE 'CHICAGO%';
select * from am_ciudad where Ciu_Nombre LIKE '%South Chicago%';
第二个匹配,因为它以“chicago”单词开头,但在查询有前缀的情况下,有没有办法在查询字符串中搜索至少一个匹配项?