Trail Blazer Knowledge Base

 

Home : Queries : SQL Wildcards

Knowledge Base







User:

Password:



Article ID: KB115
Keyword Name: SQL Wildcards, Wildcard, SQL, Search, Query, Special, Character, Custom, Advanced,fuzzy,general,logic
Created: February 15, 2017
Viewed: 16840

SQL Wildcards

 

 

/n - field not blank

/b - field is blank

% - begin with this character if you are unsure what the field begins with.  Useful when lookinig for people with a common email domain like: %gmail.com or %hotmail.com

 

4_0 the underscore is a wildcard.  In this case the 2nd postion can contain ANY character. This query in Trail Blazer will return all records that begin with 4 and have a 0 in the 3rd position.  Examples: 410, 420, 430, etc.  Also 4A0, 4B0, etc.

 


[abc] - brackets around letters will search for all records that begin with a, b, or c for the field in which you place this search.

 

>  - find values greater than...  Example: >h in the lastname search field finds all records where the last names begin with h and greater.

 

< - find values less than... Example: <h in the lastname search field finds all records where the last names have letters less than h.  

 

The < and > searches can have additional letters.  For instance, you can search for <abc will find names that begin with Aaa through Abb,  or >zt will find names that being with Zu through to the end of the alphabet.

 

If you want to search for the [ character you would enclose the bracket in brackets:  [[].


If you would like to search for just a specific couple of people you can separate the criteria with a comma.  This creates an OR condition.

For example, I am looking for 2 people in my database.  Their last names are Lee and Jaworski.

 

In the Last Name search field enter Lee,Jawor

 

The results will return EVERYONE whose last name begins with Lee OR Jawor.

 

If those results return too many records, you can enter their first names into the first name field again separated by commas.

 

What if the name you are looking for is REALLY hard to spell?

Now for some fun.  The name Chmielewski is a challenging name to spell (and pronounce).  But if I'm given the name phonetically it sounds like this:

shim-ah-LES-skee

If I listen to the phonetics I can figure out there is a C or S in the first position.  An M, an L, and an SKY or SKI sound in the name.

Here's how you could search for this:

[cs]%m%l%sk

It breaksdown like this:


[cs] it begins with a C or an S (Trail Blazer queries are not case sensitive)
% we don't know what or how many characters follows the C or S.
m  there's a letter M somewhere in the middle of the name.
%  we don't know what or how many characters follows the M.
l  there's a letter L somewhere in the middle of the name.
% we don't know what or how many characters follows the L.
sk towards the end of the name we believe there is an SK letter combination.

 

By default Trail Blazer adds a % to the end of ALL text queries.  You only need enter the first few letters to get a match.

 

 

 

 

 

 

search, shortcuts

 

Are you ready to learn more? Contact Us