Character | Description | Example |
---|---|---|
% | Represents zero or more characters | br% finds br, bracelet, break, and brink |
_ | Represents a single character | f_r finds far, fir, for, and fur |
[] | Represents any single character within the brackets | s[ia]nk finds sink and sank, but not sunk |
[^] | Represents any character but not those specified in the brackets | s[^ia]nk finds sunk, but not sink and sank |
[-] | Represents any single character within the specified range | s[e-o]n finds sin and son, but not sun |
Another thing worth mentioning here is that all wildcards can be used in combinations to make your search more flexible.
Let us illustrate the wildcard syntax on the AdventureWorks2019 sample database. Here are the first 15 records from the Person.Address table that we will use in our examples.
AddressID | AddressLine1 | AddressLine2 | City | StateProvinceID | PostalCode |
---|---|---|---|---|---|
1 | 714 Pine Tree St | 4th FL | Riverside | 7 | 64467 |
2 | 1026 New Rock Hill Circle | 99th FL | Wilkers-Barre | 29 | 79892 |
3 | 1759 W Fox Hill Ave | Standard Bldg | Algonquin | 24 | 29820 |
4 | 2433 West Ashwood Way | 99th FL | Wilkers-Barre | 29 | 79892 |
5 | 282 West Burwood Cir | 79th Floor | Anna | 50 | 39435 |
6 | 1263 Riverside Way | 79th Floor | Anna | 50 | 39435 |
7 | 61 Mount Court | 71th Floor | Gallup | 10 | 49517 |
8 | 61 Mount Court | 46th Floor | Ottawa | 8 | 63180 |
9 | 105 Meadowview Road | 8th Floor | Salem | 11 | 23395 |
10 | 1416 Burwood Highway | 79th Floor | Anna | 50 | 39435 |
11 | 3317 White Stonewood Loop | 65th FL | Kaufman | 25 | 17678 |
12 | 1274 NE Oak Pkwy | 65th FL | Kaufman | 25 | 17678 |
13 | 574 Woodrow Way | 49th FL | Altus | 37 | 69585 |
14 | 1026 New Rock Hill Circle | 74th FL | Seaside | 26 | 67078 |
15 | 2433 West Ashwood Way | 74th FL | Seaside | 26 | 67078 |
With the demo database at hand, here are several examples that will show you wildcards in action.
AddressID | AddressLine1 | AddressLine2 | City | StateProvinceID | PostalCode |
---|---|---|---|---|---|
9 | 105 Meadowview Road | 8th Floor | Salem | 11 | 23395 |
14 | 1026 New Rock Hill Circle | 74th FL | Seaside | 26 | 67078 |
15 | 2433 West Ashwood Way | 74th FL | Seaside | 26 | 67078 |
AddressID | AddressLine1 | AddressLine2 | City | StateProvinceID | PostalCode |
---|---|---|---|---|---|
10 | 1416 Burwood Highway | 79th Floor | Anna | 50 | 39435 |
11 | 3317 White Stonewood Loop | 65th Floor | Kaufman | 25 | 17678 |
12 | 1274 NE Oak Pkwy | 65th Floor | Kaufman | 25 | 17678 |
13 | 574 Woodrow Way | 49th Floor | Altus | 37 | 69585 |
14 | 1026 New Rock Hill Circle | 74th Floor | Seaside | 26 | 67078 |
15 | 2433 West Ashwood Way | 74th Floor | Seaside | 26 | 67078 |
AddressID | AddressLine1 | AddressLine2 | City | StateProvinceID | PostalCode |
---|---|---|---|---|---|
1 | 714 Pine Tree St | 4th FL | Riverside | 7 | 64467 |
7 | 61 Mount Court | 71th Floor | Gallup | 10 | 49517 |
9 | 105 Meadowview Road | 8th Floor | Salem | 11 | 23395 |
14 | 1026 New Rock Hill Circle | 74th FL | Seaside | 26 | 67078 |
15 | 2433 West Ashwood Way | 74th FL | Seaside | 26 | 67078 |
AddressID | AddressLine1 | AddressLine2 | City | StateProvinceID | PostalCode |
---|---|---|---|---|---|
1 | 714 Pine Tree St | 4th FL | Riverside | 7 | 64467 |
7 | 61 Mount Court | 71th Floor | Gallup | 10 | 49517 |
8 | 61 Mount Court | 46th Floor | Ottawa | 8 | 63180 |
11 | 3317 White Stonewood Loop | 65th FL | Kaufman | 25 | 17678 |
15 | 2433 West Ashwood Way | 74th FL | Seaside | 26 | 67078 |
AddressID | AddressLine1 | AddressLine2 | City | StateProvinceID | PostalCode |
---|---|---|---|---|---|
7 | 61 Mount Court | 71th Floor | Gallup | 10 | 49517 |
8 | 61 Mount Court | 46th Floor | Ottawa | 8 | 63180 |
11 | 3317 White Stonewood Loop | 65th FL | Kaufman | 25 | 17678 |
12 | 1274 NE Oak Pkwy | 65th FL | Kaufman | 25 | 17678 |
You can apply wildcards during your daily work with SQL queries in dbForge SQL Complete, an add-in for SSMS and Visual Studio that focuses on code completion, formatting, and refactoring. Additionally, you can use wildcard expansion to quickly insert a list of columns, available in your tables and views, into your SELECT statement.
We use cookies to provide you with a better experience on the Devart website. You can read more about our use of cookies in our Cookies Policy.
Click OK to continue browsing the Devart site. Be aware you can disable cookies at any time.