# Enhanced SQL Wildcards

Enhanced SQL wildcards are characters that can substitute for one or more characters when searching a relational database. The wildcards are:

- '%' -- a substitute for 0 or more characters (like '*' in DOS filenames);
- '_' -- a substitute for exactly one character (like '?' in DOS filenames);
- '^' -- when at the start of a search string, force the match to occur at the start of the strings being searched; and
- '$' -- at the end of the search string, force the match to end at the end of the strings being searched.

Some examples:

Search String | Search Type
--- | ---
dms | Documents with dms somewhere in their description
^dms | Documents whose name starts with dms
Guide$ | Documents whose description ends with Guide
^dms%Guide$ | Documents whose description starts with dms and ends with Guide
^PS_$ | 3-letter document names that start with 'PS' -- this will turn up 'PSD', 'PS4', 'PSx', etc., but not 'PS' (not enough characters to match) or 'PSD001' (too many characters to match)
^C_PS$ | 4-letter document names that start with 'C' and end with 'PS'
^PS_ | Documents that start with 'PS' and have at least 3 letters-- this will turn up 'PSD', 'PS4', 'PSx', etc., but not 'PS' (not enough characters to match)
^C_PS | 4 or more letter document names that start with 'C' and end with 'PS'
dms%Guide | Documents whose description has 'dms' followed by 'Guide'
\^%dms | Documents containing a '^' followed later by dms (demonstrates how to turn off the special meaning of '^')
dms%\$ | Documents containing dms followed later by a '$' (demonstrates how to turn off the special meaning of '$')

Last updated March 19, 2000.