select text_title tt,...... from table_test where all_text like '%西瓜 土豆 青椒%';
select text_title tt,...... from table_test where all_text like '%西瓜 土豆%' or all_text like '%土豆 青椒%' or all_text like '%西瓜 青椒%';
select text_title tt,...... from table_test where all_text like '%西瓜%' or all_text like '%土豆%' or all_text like '%青椒%';
--2.组合上述语句按匹配的长度排序显示 order by length(str)。
------解决方案-------------------- list1 = "select * from table where keyword like '%西瓜%'" list2 = "select * from table where keyword like '%土豆%'" list3 = "select * from table where keyword like '%青椒%'"
select * from #A order by (case charindex('西瓜',text_field) when 0 then 0 else 1 end) +(case charindex('土豆',text_field) when 0 then 0 else 1 end) +(case charindex('青椒',text_field) when 0 then 0 else 1 end)