Mysql 用于检查特定模式中名称的Sql查询
如何有效地查找不遵循firstname、lastname模式的名称?我使用的SQL id是主键Mysql 用于检查特定模式中名称的Sql查询,mysql,sql,Mysql,Sql,如何有效地查找不遵循firstname、lastname模式的名称?我使用的SQL id是主键 select name from Person where name not like '%,%' 这包括像firstname这样有效的模式。我该如何消除这些结果呢?我相信使用MATCH会稍微快一些。 select name from Person where instr(name, ',') = 0
select name
from Person where name not like '%,%'
这包括像firstname这样有效的模式。我该如何消除这些结果呢?我相信使用
MATCH
会稍微快一些。
select name
from Person
where instr(name, ',') = 0