When performing a full text search for a prefix, the database server uses a text index to find all rows that contain terms matching the prefix. Columns specified in a CONTAINS clause must be part of a text index. See Text indexes.
For example, suppose you want to search the Employees table for employees who live on a street that starts with haw. You can query the Employees table as follows:
SELECT Surname, Street, City FROM Employees WHERE CONTAINS ( Street, 'haw*' ); |
Surname | Street | City |
---|---|---|
Francis | 127 Hawthorne Drive | Scarborough |
An employee with the street name Haw, Hawthorpe, or Hawk would also be returned. Employees with the street names Shaw or Chawdrie, are not returned.
Individual terms in a phrase can be prefixes. For example, the phrase ' "12* haw*" '
is acceptable.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |