Here we will focus on the contains function used in full-text search to extract others'Article, I feel like I have written it. I 'd like to share it with you.
Suppose there is a table named students, where the address is a column for full text search.
1 . Query students whose addresses are in Beijing
Select Student_id, student_name
From Students
Where Contains (Address, ' Beijing ' )
Remark: Beijing is a word that must be enclosed in single quotes. Download dl.bitscn.com
2. Query student addresses in Hebei Province
SelectStudent_id, student_name
FromStudents
WhereContains(Address,'"Heibei province"')
Remark: Hebei province is a phrase that must be enclosed in double quotation marks.
China Network Management Forum bbs.bitscn.com
3. Query student addresses in Hebei province or Beijing
SelectStudent_id, student_name
FromStudents
WhereContains(Address,'"Heibei province" or Beijing')
Remark: You can specify logical operators (includingAnd,AndNot,Or).
Download dl.bitscn.com
4 . The query has ' Nanjing Road ' Address
Select Student_id, student_name
From Students
Where Contains (Address, ' Nanjing near Road ' )
Remark: The above query will return the include ' Nanjing Road ' , ' Nanjing East Road ' , ' Nanjing West Road ' .
A near B indicates that A is near B.
Www.bitscn.com
5 . Query ' Lake ' Address starting
Select Student_id, student_name
From Students
Where Contains (Address, ' "Hu *" ' )
Remark: The above query will return the include ' Hubei ' , ' Hunan ' .
Remember: * , No % .
Network Management Forum bbs_bitscn_com
6. Weighted Query
SelectStudent_id, student_name
FromStudents
WhereContains(Address,'Isabout (city weight (. 8), county Wright (. 4 ))')
Remark: isabout is the keyword of this query. Weight specifies0~The number between 1, similar to the coefficient (I understand ). Indicates that different conditions have different focuses. Download dl.bitscn.com
7 . Multi-state query of words
Select Student_id, student_name
From Students
Where Contains (Address, ' Formsof (inflectional, Street) ' )
Remark: The query returns include ' Street ' , ' Streets ' .
For a verb, different tenses are returned, such as dry, dry, dried, drying, and so on.
This article is from the csdn blog. For more information, see http://Blog.csdn.net/Htl258/Archive/2009/03/17/3996728. Aspx