【发布时间】:2021-10-20 09:52:40
【问题描述】:
我在搜索全名姓氏时遇到问题。它正在与 %% 一起使用,但我不使用它,因为所有有 'A' 的东西都在显示。搜索姓氏有其他方法吗?例如我有一个全名John Doe,我只搜索了Doe,即使我搜索了姓氏,如何得到结果?
SELECT * FROM Customers where CustomerName LIKE '%Doe%' - 这是有效的
【问题讨论】:
-
那么如果客户名字是
Doe John,你不想得到他的结果? -
@Arulkumar 我仍然想得到结果,即使 John Doe 或 Doe John 也是如此
-
这能回答你的问题吗? Match only entire words with LIKE?