百分比字符(通配符 - 需匹配的字符)(Transact-SQL)Percent character (Wildcard - Character(s) to Match) (Transact-SQL)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 是Azure SQL 数据库Azure SQL DatabaseYesAzure SQL 数据库Azure SQL Database

匹配包含零个或多个字符的任意字符串。Matches any string of zero or more characters. 此通配符既可以用作前缀也可以用作后缀。This wildcard character can be used as either a prefix or a suffix.

示例Examples

下面的示例返回 PersonAdventureWorks2012 表中所有以 Dan 开头的人员名字。The following example returns all the first names of people in the Person table of AdventureWorks2012 that start with Dan.

-- Uses AdventureWorks  
  
SELECT FirstName, LastName  
FROM Person.Person  
WHERE FirstName LIKE 'Dan%';  
GO  

另请参阅See Also

LIKE (Transact-SQL) LIKE (Transact-SQL)
运算符 (Transact-SQL) Operators (Transact-SQL)
表达式 (Transact-SQL)Expressions (Transact-SQL)
[ ](通配符 - 需匹配的字符) [ ] (Wildcard - Character(s) to Match)
[^](通配符 - 无需匹配的字符) [^] (Wildcard - Character(s) Not to Match)
(通配符 - 匹配一个字符) (Wildcard - Match One Character)