select * from CarInfo where Color like '%红%' and Title like '%马力%' and Description like '%保修%'
如果Color字段对应的是红 ,Title对应的是马力,Description对应的是保修的话
如果对应关系不对,你也可以自己调整一下
CONTAINS:(关键字)
(说明) Predicate Finds words in the order specified, such as "Romeo and Juliet."
FREETEXT:(关键字)
(说明)Predicate Finds one or more words specified, such as "apples oranges pears."
FORMSOF::(关键字)
说明:Predicate Finds word variations, such as "gardening" and "garden."
LIKE:(关键字)
说明:Predicate Finds characters that match a specified string. The percent character (%) matches any or no characters adjacent to the specified string. For example, "%he ca%" matches "the cat."
//首先是全包括的
String Sql="where";
for(int i=0;i<SqlWhere.Length-1;i++)
{
Sql=Sql+" Color like '%"+SqlWhere[i]+"%' ";//多字段自己去加
Sql=Sql+" and "
}
Sql=Sql+" Color like '%"+SqlWhere[i]+"%' ";
//作查询返回
//其次是部分包括的
String Sql="where";
for(int i=0;i<SqlWhere.Length-1;i++)
{
Sql=Sql+" Color like '%"+SqlWhere[i]+"%' ";//多字段自己去加
Sql=Sql+" or "
}
Sql=Sql+" Color like '%"+SqlWhere[i]+"%' ";
//作查询返回