Sure. A LIKE operator tells SQL that you want to bring in records that are similar, not an exact match, to whatever value you determine. For example, you are using a database of cookbooks. You only want the titles that have apple in it:
SELECT BookTitle, Author
FROM CookBooks
WHERE BookTitle LIKE '%apple%'
The "%" is the SQL wildcard for any character(s).
If you put the wildcard first, then SQL Server cannot use indexes and must do a table scan. This is inefficient and will slow down your application. If you frequently need to do this sort of thing, you should look at full text indexing instead.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.