Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Using wildcard characters as literal characters [Table of Contents] escape clause (SQL-compliant)

Transact-SQL User's Guide

[-] Chapter 2 Queries: Selecting Data from a Table
[-] Pattern matching
[-] Matching character strings: like
[-] Using wildcard characters as literal characters
[-] Square brackets (Transact-SQL extension)

Square brackets (Transact-SQL extension)

Use square brackets for the percent sign, the underscore, and right and left brackets. To search for a dash, rather than using it to specify a range, use the dash as the first character inside a set of brackets.

Using square brackets to search for wildcard characters

like clause

Searches for

like "5%"

5 followed by any string of 0 or more characters

like "5[%]"

5%

like "_n"

an, in, on, and so forth

like "[_]n"

_n

like "[a-cdf]"

a, b, c, d, or f

like "[-acdf]"

-, a, c, d, or f

like "[ [ ]"

[

like "[ ] ]"

]


Using wildcard characters as literal characters [Table of Contents] escape clause (SQL-compliant)