title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | ms.custom | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Wildcard search (%) |
Percent character (Wildcard - Character(s) to Match) (Transact-SQL) |
rwestMSFT |
randolphwest |
12/19/2022 |
sql |
t-sql |
reference |
|
|
|
|
=azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =fabric |
[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance Fabricsqldb]
Matches any string of zero or more characters. This wildcard character can be used as a prefix, a suffix, or in the middle of the string. The pattern string can contain more than one %
wildcard.
The following example returns the first and last names of people in the Person.Person
table of [!INCLUDE sssampledbobject-md], where the first name starts with Dan
.
SELECT FirstName, LastName
FROM Person.Person
WHERE FirstName LIKE 'Dan%';
GO
The following example returns the first and last names of people in the Person.Person
table of [!INCLUDE sssampledbobject-md], where the first name starts with J
and ends with n
.
SELECT FirstName, LastName
FROM Person.Person
WHERE FirstName LIKE 'J%n';
GO