From the course: From Excel to SQL

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

The LIKE operator in SQL

The LIKE operator in SQL

From the course: From Excel to SQL

The LIKE operator in SQL

- [Instructor] So, one operator you're going to find really useful when working with SQL is the LIKE operator. And the LIKE operator allows you to search for patterns within a column. So, to demonstrate this, I've set up a simple query that will search the employee's table for any employees matching a certain criteria. And for that criteria, we're going to use the LIKE operator. Now, the LIKE operator is powerful, and I'll demonstrate some of that power right now. So, let's say you want to find all employees whose last name begins with a T. To do that, we'll write the WHERE clause like this. So, WHERE last_name LIKE, and then in quotes, we'll put a T followed by the percent sign. The percent sign here represents zero, one, or multiple characters after the T, so when we were in the query, we'll see that we get back employees whose last name begin with T. We can also place multiple percent signs within a query. So if you want to find employees who have a T somewhere within their last…

Contents