---
title: "SQL Wildcards"  
description: "SQL wildcards are used for searching one or more characters from table in a database. The SQL wildcards substitute one or more character, whenever the"  
author: "Anonymous User"  
published: 2011-07-04  
updated: 2018-03-22  
canonical: https://www.mindstick.com/articles/551/sql-wildcards  
category: "database"  
tags: ["database"]  
reading_time: 2 minutes  

---

# SQL Wildcards

SQL wildcards are used for searching one or more [characters](https://answers.mindstick.com/qa/42112/who-is-the-originator-of-avengers-characters) from table in a database. The SQL wildcards substitute one or more [character](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character), whenever there is a [search for data](https://www.mindstick.com/forum/160076/explain-the-sql-select-statement-and-how-it-s-used-to-search-for-data-in-a-database) in a table of the database. The Wildcards is must be used with LIKE operator.

**There are many wildcards are used in [SQL database](https://www.mindstick.com/articles/337535/connecting-to-sql-databases-ado-dot-net-essentials), Here in which some important wildcards are given below:**

#####

##### 1. ‘%’ wildcards:

‘%’ allows you to match any [string](https://www.mindstick.com/interview/22908/what-are-java-string-class-method) of any [length](https://www.mindstick.com/interview/1915/what-is-the-difference-between-char_length-and-length) that means a substitute for zero or more characters.

##### Example:

Now we want to select the User whose name that starts with "ar" from the "userlogininfo" table.

**SelectQuery**:

```
 select username from userlogininfo where UserName like 'ar%' 
```

##### Output:

ArunKumar

Arunsingh

##### 2. ‘_’ wildcards:

‘_ ‘allows you to match on a single character that means ‘_’is looking for only one character.

##### Example:

Now we want to select the user with a first name that starts with any character, followed by "runsingh" from the "userlogininfo" table.

**[Select Query](https://www.mindstick.com/forum/12711/select-query-with-and-condition)**:

```
 select username from userlogininfo where UserName like _runsingh'
```

##### Output:

Arunsingh

##### 3. [charlist] wildcards:

[charlist] wildcards are used for any single character in charlist.

##### Example:

Now we want to select the user with a name that starts with "a" or "v" from the "userlogininfo" table.

##### Select Query:

```
  select username from userlogininfo where UserName like '[av]%'
```

##### Output:

ArunKumar

Arunsingh

Varunsingh

---

Original Source: https://www.mindstick.com/articles/551/sql-wildcards

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
