---
title: "How to Use &#8220;Like&#8221; in SQL"
description: "We have already been learning about the basics of SQL. We've learned about SQL itself and how to write select statements. We have also seen how we can create and delete tables and columns. Now, we're..."
url: https://www.inmotionhosting.com/support/server/databases/how-to-use-like-in-sql/
date: 2018-04-06
modified: 2023-06-12
author: "Christopher Maiorana"
categories: ["Working with Databases"]
type: post
lang: en
---

# How to Use &#8220;Like&#8221; in SQL

We have already been learning about the basics of SQL. We’ve learned about [SQL itself](/support/server/databases/what-is-sql/) and how to write [select statements](/support/server/databases/how-to-write-select-statements/).

We have also seen how we can [create and delete tables and columns](/support/server/databases/how-to-drop-tables-and-columns-with-sql/). Now, we’re going to learn a little bit about how to use the *Like* operator with wildcards to find very specific records in our database tables. For example, we can query our database for all people with first names that begin with the letter “C”.

SELECT * FROM respondents SELECT WHERE
"first_name" LIKE "c%";

[![search results](/support/images/stories/generic/sql_like.png)](/support/images/stories/generic/sql_like.png)

Let’s break down the above statement. You will recognize the *select* statement that starts this line. This will let SQL know we want to select (return) some records. But we can get more specific.

Next, we have the *from* clause that tells SQL which table in the database we’re interested in. In this case, we’re working with our “respondents” table again. This table contains the names and information about the people who have signed up to receive a newsletter.

The important *where* clause lets SQL know which column of the table we’re interested in. In this case, we’re working with the “first_name” column of the table. And the *like* operator lets us get specific.

We are using a *wildcard* to search only for records where the “first_name” begins with the letter C. That wildcard looks like this: `"c%"`. The quotes open and close the wildcard. The percent sign after the “c” means we don’t care what cames after the first letter, as long as the first letter is a C.

So we are basically telling SQL that we would like to get some records “like” what matches our wildcard.

A quick Google search will provide you with a wide list of accepted wildcard characters. There are so many good resources out there I hesitate to name one.
We have shown you some basic syntax for the *like* operator and how you can use it in SQL. Stay tuned in our series as we’re going to cover more SQL-related tips and tricks. Let us know in the comments below if you have any questions.
