使用以下内容:
WHERe CONCAt(customers.first_name, ' ', customers.last_name) LIKE '%John Smith%'
请注意,为了使此功能按预期工作,应修剪名字和姓氏,即,它们不应包含前导或尾随空格。最好在插入数据库之前在PHP中修剪字符串。但是您也可以像这样将修剪合并到查询中:
WHERe CONCAt(TRIm(customers.first_name), ' ', TRIm(customers.last_name)) LIKE '%John Smith%'



