Shane O’Neill looks at different ways to match patterns with the LIKE operator:
So let’s test out this bad boy using the WideWorldImporters database, see if we can find everyone with the first name of Leyla.
Simple right? And because [Sales].[Customers] uses the full name, we have to use
LIKE
.Now a developer comes along and says “Wait a second, my sister is Leila”. So we try to cheat and add a wildcard in there.
Leonardo!? Well I suppose he does count in this situation, but there’s 2 characters between the ‘e’ and the ‘a’ and I only wanted one.
Click through for a couple pattern matching tricks and look for ways to avoid Lejla in your life.