From the course: SQL Server 2014 Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Using wildcards in a WHERE clause

Using wildcards in a WHERE clause - SQL Server Tutorial

From the course: SQL Server 2014 Essential Training

Start my 1-month free trial

Using wildcards in a WHERE clause

- When working with some fields, particularly text fields, we sometimes don't want a match on the entire field. We just want to match on a piece of the field. A partial match. And SQL statements with WHERE clauses do support this. I'm going to open up a new query. We'll start off with something similar to what we used previously. Go ahead and run that. And I see that a few different Job Titles contain the word Engineering. So what if I was interested in every job title that had the word Engineer or Engineering. In order to do that I'll need to create a wildcard search where we include the text we're looking for and also some symbols to indicate a wildcard match that will match on any text. So I'll use the keyword WHERE again and again I'm looking for JobTitle. Instead of saying equal to a particular job title now I'm going to use the keyword like L-I-K-E and I want a job title that is like a phrase that will be inside of single quotes. I'll start with the single quotes and then I'll…

Contents