T-SQL 101: 22 Using the LIKE operator in T-SQL
I’ve discussed standard operators in previous posts but an interesting additional one is the LIKE operator. This allows for basic pattern matching in T-SQL predicates.
Let’s look at a simple example:
WHERE ProductName LIKE ‘Grant%’
The % symbol is a wild-card that matches any set of characters, including no characters at all. So this expression would match the following and more:
Grant Grants Cola Grants Lemonade
If we’re looking for a word that’s contained inside a string, we can use it like this:
2019-06-17