有什么方法可以在 SQL 中将“美国”与“美国”匹配?
我在数据库中存储了名称为“美国”的国家/地区。下面的查询应该从数据库中检索名为“美国”的项目。
SELECT * FROM `countries` WHERE `name` LIKE '%United States of America%'
Run Code Online (Sandbox Code Playgroud)
谢谢!
这是你想要的吗?
where 'United States of America' like concat('%', name, '%')
Run Code Online (Sandbox Code Playgroud)