SQLServer LIKE operator
Match open-ended pattern
The % wildcard appended to the beginning or end (or both) of a string will allow 0 or more of any character before the beginning or after the end of the pattern to match.
Using '%' in the middle will allow 0 or more characters between the two parts of the pattern to match.
Following statement matches for all records having FName containing string 'on' from Employees Table.
SELECT * FROM Employees WHERE FName LIKE '%on%';
Following statement matches all records having PhoneNumber starting with string '246' from Employees.
SELECT * FROM Employees WHERE PhoneNumber LIKE '246%';
Following statement matches all records having PhoneNumber ending with string '11' from Employees.
SELECT * FROM Employees WHERE PhoneNumber LIKE '%11'
All records where Fname 3rd character is 'n' from Employees.
SELECT * FROM Employees WHERE FName LIKE '__n%';