CONTAINSTABLE函数与CONTAINS谓词类似,其可以返回符合条件的多条记录,但是返回的记录是作为数据表出现在SELECT语句的FROM子句中。这个数据表里只包含两个字段:一个字段名为“KEY”,该字段显示的是全文索引的唯一索引键的内容,也就是图14.6所示界面中所创建的索引列;另一个字段名为“RANK”,该字段是排名值字段,其排名值是由系统依查询符合的程度自动生成的。CONTAINSTABLE的语法代码为:
CONTAINSTABLE ( table , { column_name | (column_list ) | * } , ' < contains_search_condition > '
[ , LANGUAGE language_term]
[ ,top_n_by_rank ]
)
< contains_search_condition > ::=
{ < simple_term >
| < prefix_term >
| < generation_term >
| < proximity_term >
| < weighted_term >
}
| { ( < contains_search_condition > )
{ { AND | & } | { AND NOT | &! } | { OR | | } }
< contains_search_condition > [ ...n ]
}
< simple_term > ::=
word | " phrase "
< prefix term > ::=
{ "word * " | "phrase *" }
< generation_term > ::=
FORMSOF ( { INFLECTIONAL | THESAURUS } , < simple_term > [ ,...n ] )
< proximity_term > ::=
CONTAINSTABLE ( table , { column_name | (column_list ) | * } , ' < contains_search_condition > '
[ , LANGUAGE language_term]
[ ,top_n_by_rank ]
)
< contains_search_condition > ::=
{ < simple_term >
| < prefix_term >
| < generation_term >
| < proximity_term >
| < weighted_term >
}
| { ( < contains_search_condition > )
{ { AND | & } | { AND NOT | &! } | { OR | | } }
< contains_search_condition > [ ...n ]
}
< simple_term > ::=
word | " phrase "
< prefix term > ::=
{ "word * " | "phrase *" }
< generation_term > ::=
FORMSOF ( { INFLECTIONAL | THESAURUS } , < simple_term > [ ,...n ] )
< proximity_term > ::=